vmassol 2003/06/19 07:06:20 Modified: src/plugins-build/jboss plugin.jelly src/plugins-build/jboss/xdocs changes.xml goals.xml Log: <action dev="vmassol" type="fix"> When generating the JBoss server configuration zip, exclude JBoss tmp and log directories from the zip. </action> <action dev="vmassol" type="update"> Change strategy for bunding J2EE modules in the jboss server configuration. This is now achieved through dependencies in <code>project.xml</code>. for any J2EE module you want to incude add a <code>jboss.bundle</code> property in the said dependency definition. </action> Revision Changes Path 1.9 +50 -58 maven/src/plugins-build/jboss/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven/src/plugins-build/jboss/plugin.jelly,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- plugin.jelly 24 Apr 2003 10:01:27 -0000 1.8 +++ plugin.jelly 19 Jun 2003 14:06:20 -0000 1.9 @@ -7,10 +7,12 @@ ============================================================================= --> <project + xmlns:ant="jelly:ant" xmlns:j="jelly:core" xmlns:util="jelly:util" xmlns:jmx="jmx" - xmlns:define="jelly:define"> + xmlns:define="jelly:define" + xmlns:artifact="artifact"> <!-- ======================================================================== @@ -28,11 +30,18 @@ --> <goal name="jboss:init"> - <!-- Check if the maven.jboss.home mandatory property is set --> - <j:set var="jbosshomeX" value="${maven.jboss.home}X"/> + <!-- Check if the maven.jboss.home mandatory property is set and point + to a valid location --> + <ant:condition property="jbosshomepresent" value="true"> + <ant:and> + <ant:isset property="maven.jboss.home"/> + <ant:available file="${maven.jboss.home}" type="dir"/> + </ant:and> + </ant:condition> + <j:set var="jbosshomepresentX" value="${jbosshomepresent}X"/> <j:choose> - <j:when test="${jbosshomeX == 'X'}"> - <fail>You need to set the maven.jboss.home property</fail> + <j:when test="${jbosshomepresentX == 'X'}"> + <fail>You need to set the maven.jboss.home property and make it point to a valid location. It currently points to [${maven.jboss.home}].</fail> </j:when> <j:otherwise> <echo>Using JBoss from ${maven.jboss.home} ...</echo> @@ -50,7 +59,8 @@ <!-- ======================================================================== - Creates a custom JBoss server configuration directory structure. + Creates a custom JBoss server configuration directory structure + (with no J2EE modules deployed). ======================================================================== --> <goal name="jboss:configure" @@ -112,79 +122,61 @@ <!-- ======================================================================== - Generates the zipped distributable. This goal is called automatically - by the "jboss:package-*" goals. + Package J2EE modules in the custom JBoss server configuration + directory structure. ======================================================================== --> - <goal name="jboss:dist"> - - <!-- Generate the distributable --> - <zip destfile="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.zip"> - <zipfileset dir="${maven.jboss.build.dir}/${maven.jboss.conf.name}" - prefix="${maven.jboss.conf.name}"/> - </zip> - - </goal> - - <!-- - ======================================================================== - Creates a custom JBoss server configuration directory structure, - packaging an EAR in it. - ======================================================================== - --> - <goal name="jboss:package-ear" - description="Creates a specific JBoss server configuration (with EAR)" - prereqs="jboss:init,ear:ear,jboss:configure"> - - <!-- Copy the EAR to install to the JBoss deploy dir. --> - <copy file="${maven.build.dir}/${maven.final.name}.ear" - todir="${maven.jboss.build.deploy.dir}"/> + <goal name="jboss:package" + description="Creates a specific JBoss server configuration" + prereqs="jboss:init,jboss:configure"> - <attainGoal name="jboss:dist"/> + <j:forEach var="dep" items="${pom.dependencies}"> + <j:if test="${dep.getProperty('jboss.bundle')=='true'}"> + <ant:echo>Bundling: (${dep.groupId}, ${dep.artifactId}, ${dep.type})</ant:echo> + + <!-- TODO: Use getDependencyPath() once it supports artifacts other + than jars --> + <copy todir="${maven.jboss.build.deploy.dir}" + file="${maven.repo.local}/${dep.artifactDirectory}/${dep.type}s/${dep.artifact}"/> + </j:if> + </j:forEach> </goal> <!-- ======================================================================== - Creates a custom JBoss server configuration directory structure, - packaging a WAR in it. + Generates the zipped JBoss configuration. ======================================================================== --> - <goal name="jboss:package-war" - description="Creates a specific JBoss server configuration (with WAR)" - prereqs="jboss:init,war:war,jboss:configure"> + <goal name="jboss:dist" prereqs="jboss:package" + description="Generate zipped JBoss configuration"> - <j:set var="warBuildDir" - value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/> - <j:set var="warFinalName" - value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.final.name')}"/> - - <!-- Copy the WAR to install to the JBoss deploy dir. --> - <copy file="${warBuildDir}/${warFinalName}" - todir="${maven.jboss.build.deploy.dir}"/> - - <attainGoal name="jboss:dist"/> + <!-- Generate the distributable --> + <zip destfile="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.zip"> + <zipfileset dir="${maven.jboss.build.dir}/${maven.jboss.conf.name}" + prefix="${maven.jboss.conf.name}"> + <exclude name="tmp/**"/> + <exclude name="log/**"/> + </zipfileset> + </zip> </goal> <!-- ======================================================================== - Creates a custom JBoss server configuration directory structure, - packaging an EJB-JAR in it. + Install the produced zip artifact to the local repository ======================================================================== --> - <goal name="jboss:package-ejb" - description="Creates a specific JBoss server configuration (with EJB-JAR)" - prereqs="jboss:init,ejb:ejb,jboss:configure"> + <goal name="jboss:install" prereqs="jboss:dist" + description="Install the zip into the local repository"> - <!-- Copy the EJB-JAR to install to the JBoss deploy dir. --> - <copy file="${maven.build.dir}/${maven.final.name}.jar" - todir="${maven.jboss.build.deploy.dir}"/> - - <attainGoal name="jboss:dist"/> + <artifact:install + artifact="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.zip" + type="zip" + project="${pom}"/> </goal> - + <!-- ======================================================================== Start JBoss using our specific server configuration. 1.9 +11 -0 maven/src/plugins-build/jboss/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/maven/src/plugins-build/jboss/xdocs/changes.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- changes.xml 17 Jun 2003 12:38:52 -0000 1.8 +++ changes.xml 19 Jun 2003 14:06:20 -0000 1.9 @@ -8,6 +8,17 @@ <body> <release version="1.2" date="in CVS"> + <action dev="vmassol" type="fix"> + When generating the JBoss server configuration zip, exclude + JBoss tmp and log directories from the zip. + </action> + <action dev="vmassol" type="update"> + Change strategy for bunding J2EE modules in the jboss server + configuration. This is now achieved through dependencies in + <code>project.xml</code>. for any J2EE module you want to incude + add a <code>jboss.bundle</code> property in the said dependency + definition. + </action> </release> <release version="1.1" date="2003-06-17"> 1.4 +7 -18 maven/src/plugins-build/jboss/xdocs/goals.xml Index: goals.xml =================================================================== RCS file: /home/cvs/maven/src/plugins-build/jboss/xdocs/goals.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- goals.xml 24 Apr 2003 06:47:28 -0000 1.3 +++ goals.xml 19 Jun 2003 14:06:20 -0000 1.4 @@ -10,34 +10,23 @@ <goal> <name>jboss</name> <description> - Default goal. Does the same as <code>jboss:configure</code>. + Default goal. Does the same as <code>jboss:package</code>. </description> </goal> <goal> <name>jboss:configure</name> <description> - Creates a custom JBoss server configuration directory structure. - </description> - </goal> - <goal> - <name>jboss:package-ear</name> - <description> - Creates a custom JBoss server configuration directory structure - and deploys an EAR in it. - </description> - </goal> - <goal> - <name>jboss:package-ejb</name> - <description> Creates a custom JBoss server configuration directory structure - and deploys an EJB-JAR in it. + (with no J2EE modules deployed in it). </description> </goal> <goal> - <name>jboss:package-war</name> + <name>jboss:package</name> <description> - Creates a custom JBoss server configuration directory structure - and deploys a WAR in it. + Calls the <code>jboss:configure</code> goal and deploys all J2EE + modules marked with the + <code><jboss.bundle>true</jboss.bundle></code> + property in the project dependency definition. </description> </goal> <goal>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]