michal 2003/06/16 07:40:25 Modified: src/plugins-build/war plugin.jelly Log: Added deploy, install goals Revision Changes Path 1.17 +129 -57 maven/src/plugins-build/war/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven/src/plugins-build/war/plugin.jelly,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- plugin.jelly 16 Jun 2003 10:06:47 -0000 1.16 +++ plugin.jelly 16 Jun 2003 14:40:25 -0000 1.17 @@ -2,7 +2,10 @@ <project xmlns:j="jelly:core" xmlns:license="license" - xmlns:util="jelly:util"> + xmlns:util="jelly:util" + xmlns:ant="jelly:ant" + xmlns:artifact="artifact" + > <!--==================================================================--> <!-- Default goal : Builds a war file --> @@ -15,7 +18,7 @@ <goal name="war:init" description="Initialize the file system and attain any necessary goals"> - <available property="webSourcesPresent" type="dir" + <ant:available property="webSourcesPresent" type="dir" file="${maven.war.src}"/> <j:if test="${sourcesPresent == 'true'}"> @@ -23,9 +26,12 @@ <attainGoal name="test:test"/> </j:if> - <property name="maven.war.final.name" - value="${pom.artifactId}.war"/> + <ant:property name="maven.war.final.name" + value="${maven.final.name}.war"/> + <ant:echo>final:${maven.final.name}</ant:echo> + + <ant:echo>WAR final:${maven.war.final.name}</ant:echo> </goal> <!--==================================================================--> @@ -33,58 +39,68 @@ <!--==================================================================--> <goal name="war:war" prereqs="war:init" description="Build a war file"> - <echo>Building WAR ${pom.artifactId}</echo> + <ant:echo>Building WAR ${pom.artifactId}</ant:echo> - <mkdir dir="${maven.war.build.dir}" /> - <war warfile="${maven.war.build.dir}/${maven.war.final.name}" + <ant:mkdir dir="${maven.war.build.dir}" /> + <ant:war warfile="${maven.war.build.dir}/${maven.war.final.name}" webxml="${maven.war.webxml}" update="true"> <j:if test="${webSourcesPresent == 'true'}"> - <fileset dir="${maven.war.src}"> - <exclude name="WEB-INF/web.xml"/> - <exclude name="WEB-INF/classes/**/*.class"/> - <exclude name="WEB-INF/lib/*.jar"/> - </fileset> + <ant:fileset dir="${maven.war.src}"> + <ant:exclude name="WEB-INF/web.xml"/> + <ant:exclude name="WEB-INF/classes/**/*.class"/> + <ant:exclude name="WEB-INF/lib/*.jar"/> + </ant:fileset> </j:if> <j:forEach var="dep" items="${pom.dependencies}"> <j:if test="${dep.getProperty('war.bundle.jar')=='true'}"> - <lib dir="${maven.repo.local}/${dep.artifactDirectory}/jars/"> - <include name="${dep.artifact}"/> - </lib> + <ant:echo> + DEPRECATION WARNING: + Use : war.bundle instead of war.bundle.jar + </ant:echo> + <ant:lib dir="${maven.repo.local}/${dep.artifactDirectory}/jars/"> + <ant:include name="${dep.artifact}"/> + </ant:lib> + </j:if> + <j:if test="${dep.getProperty('war.bundle')=='true' and dep.type =='jar' }"> + <ant:lib dir="${maven.repo.local}/${dep.artifactDirectory}/jars/"> + <ant:include name="${dep.artifact}"/> + </ant:lib> </j:if> </j:forEach> <j:if test="${sourcesPresent == 'true'}"> - <classes dir="${maven.build.dest}" - includes="${maven.war.classes.includes}" - excludes="${maven.war.classes.excludes}"/> + <ant:classes + dir="${maven.build.dest}" + include="${maven.war.classes.includes}" + exclude="${maven.war.classes.excludes}"/> </j:if> <j:set var="licenseFileName"><license:fileName/></j:set> <util:file name="${licenseFileName}" var="licenseFile"/> - <metainf dir="${licenseFile.canonicalFile.parent}"> - <include name="${licenseFile.canonicalFile.name}"/> - </metainf> - - <manifest> - <attribute name="Built-By" value="${user.name}" /> - <section name="${pom.package}"> - <attribute name="Specification-Title" value="${pom.artifactId}" /> - <attribute name="Specification-Version" + <ant:metainf dir="${licenseFile.canonicalFile.parent}"> + <ant:include name="${licenseFile.canonicalFile.name}"/> + </ant:metainf> + + <ant:manifest> + <ant:attribute name="Built-By" value="${user.name}" /> + <ant:section name="${pom.package}"> + <ant:attribute name="Specification-Title" value="${pom.artifactId}" /> + <ant:attribute name="Specification-Version" value="${pom.currentVersion}" /> - <attribute name="Specification-Vendor" + <ant:attribute name="Specification-Vendor" value="${pom.organization.name}" /> - <attribute name="Implementation-Title" + <ant:attribute name="Implementation-Title" value="${pom.package}" /> - <attribute name="Implementation-Version" + <ant:attribute name="Implementation-Version" value="${pom.currentVersion}" /> - <attribute name="Implementation-Vendor" + <ant:attribute name="Implementation-Vendor" value="${pom.organization.name}" /> - </section> - </manifest> + </ant:section> + </ant:manifest> - </war> + </ant:war> </goal> @@ -94,37 +110,47 @@ <goal name="war:webapp" prereqs="war:init" description="Build a webapp directory"> - <echo>Assembling webapp ${pom.artifactId}</echo> + <ant:echo>Assembling webapp ${pom.artifactId}</ant:echo> - <mkdir dir="${maven.war.webapp.dir}"/> + <ant:mkdir dir="${maven.war.webapp.dir}"/> - <property name="webapp.build.webinf" value="${maven.war.webapp.dir}/WEB-INF"/> - <mkdir dir="${webapp.build.webinf}"/> + <ant:property name="webapp.build.webinf" value="${maven.war.webapp.dir}/WEB-INF"/> + <ant:mkdir dir="${webapp.build.webinf}"/> - <property name="webapp.build.lib" value="${webapp.build.webinf}/lib"/> - <mkdir dir="${webapp.build.lib}"/> + <ant:property name="webapp.build.lib" value="${webapp.build.webinf}/lib"/> + <ant:mkdir dir="${webapp.build.lib}"/> - <property name="webapp.build.classes" value="${webapp.build.webinf}/classes"/> - <mkdir dir="${webapp.build.classes}"/> + <ant:property name="webapp.build.classes" value="${webapp.build.webinf}/classes"/> + <ant:mkdir dir="${webapp.build.classes}"/> <j:if test="${webSourcesPresent == 'true'}"> - <copy todir="${maven.war.webapp.dir}"> - <fileset dir="${maven.war.src}"/> - </copy> + <ant:copy todir="${maven.war.webapp.dir}"> + <ant:fileset dir="${maven.war.src}"/> + </ant:copy> </j:if> <j:forEach var="dep" items="${pom.dependencies}"> + + <j:if test="${dep.getProperty('war.bundle')=='true' and dep.type =='jar' }"> + <ant:copy todir="${webapp.build.lib}" + file="${maven.repo.local}/${dep.artifactDirectory}/jars/${dep.artifact}"/> + </j:if> <j:if test="${dep.getProperty('war.bundle.jar')=='true'}"> - <copy todir="${webapp.build.lib}" + <ant:echo> + DEPRECATION WARNING: + Use : war.bundle instead of war.bundle.jar + </ant:echo> + <ant:copy todir="${webapp.build.lib}" file="${maven.repo.local}/${dep.artifactDirectory}/jars/${dep.artifact}"/> </j:if> </j:forEach> - <copy todir="${webapp.build.classes}"> - <fileset dir="${maven.build.dest}" - includes="${maven.war.classes.includes}" - excludes="${maven.war.classes.excludes}"/> - </copy> + <ant:copy todir="${webapp.build.classes}"> + <ant:fileset dir="${maven.build.dest}"> + <ant:include name="${maven.war.classes.includes}" /> + <ant:exclude name="${maven.war.classes.excludes}" /> + </ant:fileset> + </ant:copy> </goal> @@ -134,14 +160,61 @@ <goal name="war:install" prereqs="war:war" description="Install the war in the local repository"> + + <artifact:install + artifact="${maven.war.build.dir}/${maven.war.final.name}" + type="war" + project="${pom}" + /> + + </goal> + + + + <!--==================================================================--> + <!-- Install the snapshot version of the war in the local repository --> + <!--==================================================================--> + <goal name="war:install-snapshot" + prereqs="war:war" + description="Install the snapshot version of the war in the local repository"> + + <artifact:install-snapshot + artifact="${maven.war.build.dir}/${maven.war.final.name}" + type="war" + project="${pom}" + /> + + </goal> - <property name="maven.war.install.dir" - value="${maven.repo.local}/${pom.artifactDirectory}/wars"/> - <mkdir dir="${maven.war.install.dir}"/> - <copy file="${maven.war.build.dir}/${maven.war.final.name}" - tofile="${maven.war.install.dir}/${maven.war.final.name}"/> + <!--==================================================================--> + <!-- Deploys the war to the local repository --> + <!--==================================================================--> + <goal name="war:deploy" + prereqs="war:war" + description="Deploys the war to the remote repository"> + <artifact:deploy + artifact="${maven.war.build.dir}/${maven.war.final.name}" + type="war" + project="${pom}" + /> + + </goal> + + <!--==================================================================--> + <!-- Deploys the snapshoot of the war to the remote repository --> + <!--==================================================================--> + <goal name="war:deploy-snapshot" + prereqs="war:war" + description="Deploys the snapshot version of the war to remote repository"> + <artifact:deploy-snapshot + artifact="${maven.war.build.dir}/${maven.war.final.name}" + type="war" + project="${pom}" + /> </goal> + + <!--==================================================================--> <!-- Special no-op goal which can be used by other plugin which need --> @@ -149,5 +222,4 @@ <!-- temporary, until we get explicit plugin dependencies. --> <!--==================================================================--> <goal name="war:load"/> - </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]