dion        2004/02/19 20:49:08

  Modified:    ear/xdocs changes.xml properties.xml
               ear/src/plugin-test project.properties maven.xml project.xml
               ear      plugin.jelly
  Removed:     ear/src/plugin-test/src/application/META-INF application.xml
  Log:
  - Apply MPEAR-14

  - Added to the plugin tests a check to make sure the ear includes

    the jars marked by ear.bundle and ear.module and that ear.module generates

    a java module in the generated application.xml

  - Updated documentation
  
  Revision  Changes    Path
  1.13      +8 -0      maven-plugins/ear/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/xdocs/changes.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- changes.xml       26 Nov 2003 21:21:54 -0000      1.12
  +++ changes.xml       20 Feb 2004 04:49:07 -0000      1.13
  @@ -7,6 +7,14 @@
     <body>
   
       <release version="1.4" date="in CVS">
  +      <action dev="dion" type="fix" issue="MPEAR-14">
  +        Introduced ear.module property to mark jars as being java client modules
  +      </action>
  +      <action dev="dion" type="update">
  +        Added to the plugin tests a check to make sure the ear includes
  +        the jars marked by ear.bundle and ear.module and that ear.module generates
  +        a java module in the generated application.xml
  +      </action>
       </release>
   
       <release version="1.3" date="2003-11-26">
  
  
  
  1.8       +17 -2     maven-plugins/ear/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/xdocs/properties.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- properties.xml    25 Jul 2003 14:59:16 -0000      1.7
  +++ properties.xml    20 Feb 2004 04:49:07 -0000      1.8
  @@ -101,7 +101,7 @@
       <dependency>
         <id>id</id>
         <version>aversion</version>
  -      <type>jar<type>
  +      <type>ejb<type>
         <properties>
           <ear.bundle>true</ear.bundle>
         </properties>
  @@ -124,7 +124,22 @@
         </properties>
       </dependency>
     ]]></source>
  -      
  +  
  +       <p>
  +         Please note that if a jar is a java client module, you will need to declare
  +         it using the <code>ear.module</code> property, rather than ear.bundle:
  +       </p>
  +  <source><![CDATA[
  +    <dependency>
  +      <id>my-java-client</id>
  +      <version>aversion</version>
  +      <type>jar<type>
  +      <properties>
  +        <ear.module>true</ear.module>
  +      </properties>
  +    </dependency>
  +  ]]></source>
  +
       </section>
     </body>
   </document>
  
  
  
  1.2       +1 -8      maven-plugins/ear/src/plugin-test/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/src/plugin-test/project.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.properties        22 Sep 2003 01:21:49 -0000      1.1
  +++ project.properties        20 Feb 2004 04:49:07 -0000      1.2
  @@ -1,10 +1,3 @@
   maven.deployable.component=${maven.final.name}.ear
   maven.j2ee.ear.appxml=${maven.conf.dir}/application.xml
  -maven.weblogic.home=C:\\bea\\wlserver6.1
  -maven.weblogic.host=localhost
  -maven.weblogic.port=7001
  -maven.weblogic.server=myserver
  -maven.weblogic.username=system
  -maven.weblogic.password=weblogic
  -maven.weblogic.component=${maven.final.name}
  -maven.weblogic.debug=true
  +maven.ear.appxml.generate=true
  
  
  
  1.3       +32 -1     maven-plugins/ear/src/plugin-test/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/src/plugin-test/maven.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- maven.xml 23 Sep 2003 14:50:30 -0000      1.2
  +++ maven.xml 20 Feb 2004 04:49:07 -0000      1.3
  @@ -1,4 +1,4 @@
  -<project xmlns:j="jelly:core" xmlns:u="jelly:util">
  +<project xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:x="jelly:xml">
   
     <goal name="testPlugin" prereqs="test-ear">
       <attainGoal name="clean"/>
  @@ -7,11 +7,42 @@
     <goal name="test-ear">
       <attainGoal name="ear"/>
   
  +    <!-- tests that the ear is generated -->
       <j:set var="expectedFile" 
         value="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
       <u:file var="file" name="${expectedFile}" />
       <j:if test="${!(file.exists())}">
         <fail>${expectedFile} not generated</fail>
  +    </j:if>
  +    
  +    <!-- unzip the ear and look for the jars -->
  +    <j:set var="earFile" 
  +      value="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
  +    <j:set var="unzipDir" value= "${maven.build.dir}/eartest"/>
  +    <mkdir dir="${unzipDir}"/>
  +    <unzip src="${earFile}" dest="${unzipDir}"/>
  +    <!-- check for commons-logging -->
  +    <j:set var="expectedFile" value="${unzipDir}/commons-logging-1.0.3.jar"/>
  +    <u:file var="file" name="${expectedFile}" />
  +    <j:if test="${!(file.exists())}">
  +      <fail>${expectedFile} not bundled</fail>
  +    </j:if>
  +    <!-- check for commons-collections -->
  +    <j:set var="expectedFile" value="${unzipDir}/commons-collections-2.1.jar"/>
  +    <u:file var="file" name="${expectedFile}" />
  +    <j:if test="${!(file.exists())}">
  +      <fail>${expectedFile} not bundled</fail>
  +    </j:if>
  +
  +    <!-- check application.xml got a java module in it -->
  +    <u:file var="appXml" name="${unzipDir}/META-INF/application.xml"/>
  +    <x:parse var="applicationDoc" xml="${appXml.toURL()}"/>
  +    <x:set var="firstJavaModule" 
select="string($applicationDoc/application/module/java)"/>
  +    <echo>output is ${a}</echo>
  +    <j:if test="${firstJavaModule != 'commons-collections-2.1.jar'}">
  +      <fail>
  +        commons-collections-2.1.jar not bundled as a java module found 
'${firstJavaModule}' instead
  +      </fail>
       </j:if>
   
     </goal>
  
  
  
  1.6       +18 -12    maven-plugins/ear/src/plugin-test/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/src/plugin-test/project.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project.xml       29 Dec 2003 04:38:05 -0000      1.5
  +++ project.xml       20 Feb 2004 04:49:07 -0000      1.6
  @@ -40,7 +40,24 @@
         <version>1.0.3</version>
         <url>http://jakarta.apache.org/commons/logging.html</url>
         <properties>
  -        <ear.bundle.jar>true</ear.bundle.jar>
  +        <ear.bundle>true</ear.bundle>
  +      </properties>
  +    </dependency>
  +    <dependency>
  +      <groupId>commons-collections</groupId>
  +      <artifactId>commons-collections</artifactId>
  +      <version>2.1</version>
  +      <url>http://jakarta.apache.org/commons/collections/</url>
  +      <properties>
  +        <ear.module>true</ear.module>
  +      </properties>
  +    </dependency>
  +    <dependency>
  +      <groupId>commons-jelly</groupId>
  +      <artifactId>commons-jelly-tags-xml</artifactId>
  +      <version>20030211.142705</version>
  +      <properties>
  +        <classloader>root.maven</classloader>
         </properties>
       </dependency>
     </dependencies>
  @@ -49,16 +66,5 @@
       <sourceDirectory>src</sourceDirectory>
       <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
       <!-- Resources that are packaged up inside the JAR file -->
  -
  -    <resources>
  -    <!--includes>
  -        <include>*.xsd</include>
  -        <include>log4j.properties</include>
  -      </includes-->
  -</resources>
  -    <!-- Integration unit test cases -->
  -
  -    <integrationUnitTest/>
  -    <jars></jars>
     </build>
   </project>
  
  
  
  1.16      +7 -5      maven-plugins/ear/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/plugin.jelly,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- plugin.jelly      19 Oct 2003 23:35:33 -0000      1.15
  +++ plugin.jelly      20 Feb 2004 04:49:07 -0000      1.16
  @@ -51,7 +51,7 @@
         <!-- include marked dependencies -->
         <j:forEach var="lib" items="${pom.artifacts}">
           <j:set var="dep" value="${lib.dependency}"/>      
  -        <j:if test="${dep.getProperty('ear.bundle')=='true'}">
  +        <j:if test="${dep.getProperty('ear.bundle')=='true' || 
dep.getProperty('ear.module')=='true'}">
             
             <!-- 
              We know that this dep "wants" to be bundled.
  @@ -125,7 +125,7 @@
           <x:element name="display-name">${maven.ear.displayname}</x:element>
           <j:forEach var="lib" items="${pom.artifacts}">
              <j:set var="dep" value="${lib.dependency}"/>
  -          <j:if test="${dep.getProperty('ear.bundle')=='true'}">
  +          <j:if test="${dep.getProperty('ear.bundle')=='true' || 
dep.getProperty('ear.module')=='true'}">
               <j:choose>
                 <j:when test="${dep.type=='war'}">
                   <x:element name="module">
  @@ -141,9 +141,11 @@
                   </x:element>
                 </j:when>       
                 <j:when test="${dep.type=='jar'}">
  -                <x:element name="module">  
  -                  <x:element name="java">${dep.getArtifact()}</x:element>           
      
  -                </x:element>
  +                <j:if test="${dep.getProperty('ear.module')=='true'}">
  +                  <x:element name="module">  
  +                    <x:element name="java">${dep.getArtifact()}</x:element>         
        
  +                  </x:element>
  +                </j:if>
                 </j:when>
                 <j:when test="${dep.type=='rar'}">
                   <x:element name="module">  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to