public

How to Mavenize Liferay Plugins Ant build.xml

  • Download Gist
mavenized-liferay-plugins-build.xml
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<?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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.