From: <jo...@us...> - 2004-11-16 18:22:25
|
joehni 04/11/16 10:22:18 Modified: javaapp plugin.jelly plugin.properties project.xml javaapp/xdocs changes.xml goals.xml properties.xml Log: Support multiproject goals, removed dependency for deploy in favour of artifact. Revision Changes Path 1.7 +86 -14 maven-plugins/javaapp/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/plugin.jelly,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- plugin.jelly 16 Nov 2004 12:20:16 -0000 1.6 +++ plugin.jelly 16 Nov 2004 18:22:17 -0000 1.7 @@ -1,8 +1,8 @@ <?xml version="1.0"?> <project xmlns:j="jelly:core" - xmlns:deploy="deploy" xmlns:resources="resources" + xmlns:artifact="artifact" xmlns:u="jelly:util" xmlns:ant="jelly:ant"> @@ -13,6 +13,14 @@ <goal name="javaapp" prereqs="javaapp:jar" description="Create the deliverable jar file."/> + + <!-- ================================================================== --> + <!-- javaapp:javaapp --> + <!-- ================================================================== --> + + <goal name="javaapp:javaapp" + prereqs="javaapp" + description="Run goal javaapp for multiproject"/> <!-- ================================================================== --> <!-- javaapp:prepare-filesystem --> @@ -60,6 +68,7 @@ <echo>maven.javaapp.app.dir = ${maven.javaapp.app.dir}</echo> <echo>maven.javaapp.jar.name = ${maven.javaapp.jar.name}</echo> <echo>maven.javaapp.jar.exclude = ${maven.javaapp.jar.exclude}</echo> + <echo>maven.javaapp.jar.keep.extention = ${maven.javaapp.jar.keep.extension}</echo> <echo>maven.javaapp.mainclass = ${maven.javaapp.mainclass}</echo> <echo>maven.javaapp.jvmargs = ${maven.javaapp.jvmargs}</echo> <echo>maven.javaapp.sysproperties = ${maven.javaapp.sysproperties}</echo> @@ -175,7 +184,14 @@ prereqs="javaapp:prepare-filesystem,javaapp:support-uberjar-bundle"> <echo>Copy dependent JARs into ${maven.javaapp.app.dir}/lib</echo> - <deploy:copy-deps todir="${maven.javaapp.app.dir}/lib" excludes="${maven.javaapp.jar.exclude}"/> + + <u:tokenize var="excludes" delim=",">${maven.javaapp.jar.exclude}</u:tokenize> + <j:forEach var="lib" items="${pom.artifacts}"> + <j:set var="dep" value="${lib.dependency}"/> + <j:if test="${!excludes.contains(dep.artifactId)}"> + <ant:copy todir="${maven.javaapp.app.dir}/lib" file="${lib.path}"/> + </j:if> + </j:forEach> </goal> @@ -221,18 +237,74 @@ <!-- ================================================================== --> <!-- javaapp:install --> <!-- ================================================================== --> - - <goal name="javaapp:install" - prereqs="javaapp:jar" - description="Install the application jar in the local repository"> - - <property name="javaappdir__" value="${maven.repo.local}/${pom.artifactDirectory}/apps"/> - <mkdir dir="${javaappdir__}"/> - <copy - file="${maven.build.dir}/${maven.javaapp.jar.name}" - todir="${javaappdir__}" - /> + + <goal name="javaapp:install" + prereqs="javaapp:jar" + description="Install the application in the local repository"> + + <j:new var="typeHandler" className="net.sourceforge.mavenplugins.javaapp.JavaAppArtifactTypeHandler"> + <j:arg type="boolean" value="${maven.javaapp.jar.keep.extension}"/> + </j:new> + <artifact:install + artifact="${maven.javaapp.final.name}" + type="${maven.javaapp.type}" + project="${pom}" + typeHandler="${typeHandler}"/> - </goal> + </goal> + <!--=====================================================================--> + <!-- javaapp:install-snapshot --> + <!--=====================================================================--> + <goal name="javaapp:install-snapshot" + prereqs="javaapp:jar" + description="Install the snapshot version of the application in the local repository"> + + <j:new var="typeHandler" className="net.sourceforge.mavenplugins.javaapp.JavaAppArtifactTypeHandler"> + <j:arg type="boolean" value="${maven.javaapp.jar.keep.extension}"/> + </j:new> + <artifact:install-snapshot + artifact="${maven.javaapp.final.name}" + type="${maven.javaapp.type}" + project="${pom}" + typeHandler="${typeHandler}"/> + + </goal> + + <!--==================================================================--> + <!-- javaapp:deploy --> + <!--==================================================================--> + <goal name="javaapp:deploy" + prereqs="javaapp:jar" + description="Deploys the javaapp to the remote repository"> + + <j:new var="typeHandler" className="net.sourceforge.mavenplugins.javaapp.JavaAppArtifactTypeHandler"> + <j:arg type="boolean" value="${maven.javaapp.jar.keep.extension}"/> + </j:new> + <artifact:deploy + artifact="${maven.javaapp.final.name}" + type="${maven.javaapp.type}" + project="${pom}" + typeHandler="${typeHandler}"/> + + </goal> + + <!--==================================================================--> + <!-- javaapp:deploy-snapshot --> + <!--==================================================================--> + <goal name="javaapp:deploy-snapshot" + prereqs="javaapp:jar" + description="Deploys the snapshot version of the javaapp to remote repository"> + + <j:new var="typeHandler" className="net.sourceforge.mavenplugins.javaapp.JavaAppArtifactTypeHandler"> + <j:arg type="boolean" value="${maven.javaapp.jar.keep.extension}"/> + </j:new> + <artifact:deploy-snapshot + artifact="${maven.javaapp.final.name}" + type="${maven.javaapp.type}" + project="${pom}" + typeHandler="${typeHandler}"/> + + </goal> + </project> 1.5 +9 -2 maven-plugins/javaapp/plugin.properties Index: plugin.properties =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/plugin.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- plugin.properties 21 Oct 2003 16:20:58 -0000 1.4 +++ plugin.properties 16 Nov 2004 18:22:17 -0000 1.5 @@ -19,7 +19,7 @@ # The name of the created artifact # -maven.javaapp.jar.name = ${pom.artifactId}-${maven.javaapp.type}-${pom.currentVersion}.jar +maven.javaapp.jar.name = ${maven.final.name}-${maven.javaapp.type}.jar # @@ -33,7 +33,7 @@ # The build directory of the plugin # -maven.javaapp.app.dir = ${maven.build.dir}/${pom.artifactId} +maven.javaapp.app.dir = ${maven.build.dir}/javaapp # @@ -42,6 +42,13 @@ maven.javaapp.jar.exclude = + +# +# Flag to keep the type as extension in the repository. +# + +maven.javaapp.jar.keep.extension = false + # # List of system properties to pass to the java application, # e.g. "-DFOO=XXX -DBAR=YYY" 1.11 +17 -26 maven-plugins/javaapp/project.xml Index: project.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- project.xml 16 Nov 2004 12:20:16 -0000 1.10 +++ project.xml 16 Nov 2004 18:22:17 -0000 1.11 @@ -55,33 +55,24 @@ </developers> <dependencies> + <dependency> + <groupId>maven</groupId> + <artifactId>maven</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.0</version> + </dependency> + <!-- test --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + </dependency> </dependencies> - <build> + <!-- inherit build from parent --> - <nagEmailAddress>tur...@ja...</nagEmailAddress> - - <sourceDirectory>src/java</sourceDirectory> - - <unitTestSourceDirectory>src/test</unitTestSourceDirectory> - <integrationUnitTestSourceDirectory/> - - <aspectSourceDirectory></aspectSourceDirectory> - - <!-- Unit test classes --> - <unitTest> - <includes> - <include>**/*Test.java</include> - </includes> - </unitTest> - - <!-- J A R R E S O U R C E S --> - <!-- Resources that are packaged up inside the JAR file --> - - <resources> - </resources> - - <jars> - </jars> - </build> </project> 1.4 +18 -0 maven-plugins/javaapp/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/xdocs/changes.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- changes.xml 16 Nov 2004 12:20:17 -0000 1.3 +++ changes.xml 16 Nov 2004 18:22:17 -0000 1.4 @@ -15,8 +15,26 @@ <release version="1.3-SNAPSHOT" date="in CVS"> <action dev="joehni" type="add"> + Added support for multiproject goals: + <ul> + <li>javaapp:javaapp</li> + <li>javaapp:install-snapshot</li> + <li>javaapp:deploy</li> + <li>javaapp:deploy-snapshot</li> + </ul> + </action> + <action dev="joehni" type="add"> + Added flexible extension support. + </action> + <action dev="joehni" type="add"> Added support for uberjar.bundle property. </action> + <action dev="joehni" type="update"> + Use artifact plugin for install and deploy. + </action> + <action dev="joehni" type="fix"> + Fix usage internal goal of deprecated deploy plugin. + </action> </release> <release version="1.2" date="2003-10-22"> 1.2 +22 -0 maven-plugins/javaapp/xdocs/goals.xml Index: goals.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/xdocs/goals.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- goals.xml 20 Oct 2003 14:25:19 -0000 1.1 +++ goals.xml 16 Nov 2004 18:22:17 -0000 1.2 @@ -21,10 +21,32 @@ <td>Prints diagnotic messages</td> </tr> <tr> + <td>javaapp:deploy</td> + <td>Deploy the application jar in the remote repository(ies)</td> + </tr> + <tr> + <td>javaapp:deploy-snapshot</td> + <td> + Deploy a snapshot version of the application jar in the remote + repository(ies) + </td> + </tr> + <tr> <td>javaapp:install</td> <td>Install the application jar in the local repository</td> </tr> <tr> + <td>javaapp:install-snapshot</td> + <td> + Install a snapshot version of the application jar in the local + repository + </td> + </tr> + <tr> + <td>javaapp:javaapp</td> + <td>Run goal javaapp for multiproject</td> + </tr> + <tr> <td>javaapp:jar</td> <td>Packs all dependent JARs into an executable JAR</td> </tr> 1.5 +13 -1 maven-plugins/javaapp/xdocs/properties.xml Index: properties.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/xdocs/properties.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- properties.xml 16 Nov 2004 12:20:17 -0000 1.4 +++ properties.xml 16 Nov 2004 18:22:17 -0000 1.5 @@ -4,6 +4,7 @@ <properties> <title>Properties</title> <author email="sie...@it...">Siegfried Goeschl</author> + <author email="joe...@gm...">Jörg Schaible</author> </properties> <body> @@ -29,10 +30,21 @@ </tr> <tr> + <td>maven.javaapp.keep.extension</td> + <td>Yes</td> + <td> + Keep the <code>maven.javaapp.type</code> as extension of the + resulting application or use simply .jar. Defaults to + <code>false</code> + </td> + </tr> + + <tr> <td>maven.javaapp.jar.name</td> <td>Yes</td> <td> - The name of the generated executable JAR + The name of the generated executable JAR. Defaults to + <code>${maven.final.name}-${maven.javaapp.type}.jar</code> </td> </tr> |