Created
July 24, 2016 17:47
-
-
Save neilcatalan/50c251eb22c45d26dd0b27bbe9d460d6 to your computer and use it in GitHub Desktop.
How to Mavenize Liferay Plugins Ant build.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <!-- Download Maven ant tasks jar form http://maven.apache.org/ant-tasks/download.html and drop it into your $ANT_HOME/lib --> | |
| <project name="mavenized-liferay-plugins-build" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant" default="copy-dependencies-and-deploy"> | |
| <import file="../build-common-portlet.xml" /> | |
| <property name="app.lib.dir" value="docroot/WEB-INF/lib" /> | |
| <!-- Include the your project dependencies --> | |
| <artifact:dependencies filesetId="app.cutom.deps" usescope="runtime"> | |
| <!-- Add dependency of the maven format --> | |
| <!-- e.g. for adding slf4j dependecy --> | |
| <dependency groupId="org.slf4j" artifactId="slf4j-log4j12" version="${slf4j.version}" scope="provided" /> | |
| <!-- end example--> | |
| <!-- Add more if you need, all will end up in docroot/WEB-INF/lib --> | |
| </artifact:dependencies> | |
| <!-- ================================= | |
| target: copy-dependencies | |
| ================================= --> | |
| <target name="copy-dependencies" description="copies all the dependcies"> | |
| <copy todir="${app.lib.dir}"> | |
| <fileset refid="app.cutom.deps" /> | |
| <!-- This mapper strips off all leading directory information --> | |
| <mapper type="flatten" /> | |
| </copy> | |
| </target> | |
| <!-- Just ensure that we copy all application sepecific libraries to the docroot/WEB-INF/lib folder so that its picked up by the Liferay build--> | |
| <target name="copy-dependencies-and-deploy"> | |
| <antcall target="copy-dependencies" /> | |
| <!-- Call the Liferay deploy target to deploy to the necessary ${auto.deploy.dir} - default build--> | |
| <antcall target="deploy" /> | |
| </target> | |
| </project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment