You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sn...@apache.org on 2007/01/03 20:24:56 UTC

svn commit: r492260 - in /maven/plugins/trunk/maven-ear-plugin: ./ src/main/java/org/apache/maven/plugin/ear/ src/site/apt/ src/test/java/org/apache/maven/plugin/ear/ src/test/resources/projects/project-030/expected-META-INF/ src/test/resources/project...

Author: snicoll
Date: Wed Jan  3 11:24:55 2007
New Revision: 492260

URL: http://svn.apache.org/viewvc?view=rev&rev=492260
Log:
MEAR-53: ejb-client dependencies are not included in the application.xml by default anymore (should not be treated as  J2EE application client modules)

Added:
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/expected-META-INF/
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/expected-META-INF/application.xml
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/pom.xml
Modified:
    maven/plugins/trunk/maven-ear-plugin/pom.xml
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt
    maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml

Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/pom.xml?view=diff&rev=492260&r1=492259&r2=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/pom.xml Wed Jan  3 11:24:55 2007
@@ -8,7 +8,7 @@
   <artifactId>maven-ear-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Ear plugin</name>
-  <version>2.4-SNAPSHOT</version>
+  <version>2.3.1-SNAPSHOT</version>
   <prerequisites>
     <maven>2.0</maven>
   </prerequisites>

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java?view=diff&rev=492260&r1=492259&r2=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java Wed Jan  3 11:24:55 2007
@@ -83,7 +83,7 @@
         }
         else if ( "ejb-client".equals( artifactType ) )
         {
-            return new EjbClientModule( artifact );
+            return new EjbClientModule( artifact, null );
         }
         else if ( "rar".equals( artifactType ) )
         {

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java?view=diff&rev=492260&r1=492259&r2=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java Wed Jan  3 11:24:55 2007
@@ -29,25 +29,18 @@
  * @version $Id$
  */
 public class EjbClientModule
-    extends AbstractEarModule
+    extends JarModule
 {
 
     public EjbClientModule()
     {
+        super();
     }
 
-    public EjbClientModule( Artifact a )
-    {
-        super( a );
-    }
 
-    public void appendModule( XMLWriter writer, String version )
+    public EjbClientModule( Artifact a, String defaultLibBundleDir )
     {
-        writer.startElement( MODULE_ELEMENT );
-        writer.startElement( JAVA_MODULE );
-        writer.writeText( getUri() );
-        writer.endElement();
-        writer.endElement();
+        super( a, defaultLibBundleDir );
     }
 
     public String getType()

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt?view=diff&rev=492260&r1=492259&r2=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt Wed Jan  3 11:24:55 2007
@@ -88,7 +88,7 @@
 
   * project-029: builds an EAR and make sure that system dependencies are not included in the EAR
 
-  * project-030: builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml
+  * project-030: builds an EAR and make sure that ejb-client dependencies are detected and not added by default in the generated application.xml
 
   * project-031: builds an EAR with a Jboss 4 configuration specifying the security domain and the unauthenticated-principal to use
 
@@ -101,6 +101,8 @@
   * project-035: builds an EAR with a full filename mapping and make sure that custom locations are not overriden
 
   * project-036: builds an EAR with a full filename mapping and make sure that groupIds with dots are replaced by dashes in filenames
+
+  * project-037: builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml if includeInApplicationXml is set
 
   
 

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java?view=diff&rev=492260&r1=492259&r2=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java Wed Jan  3 11:24:55 2007
@@ -321,7 +321,8 @@
     }
 
     /**
-     * Builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml.
+     * Builds an EAR and make sure that ejb-client dependencies are detected and not added by default in the
+     * generated application.xml.
      */
     public void testProject030()
         throws Exception
@@ -388,6 +389,16 @@
             "eartest-ejb-sample-two-1.0.jar", "com-foo-bar-ejb-sample-one-1.0.jar",
             "com-foo-bar-ejb-sample-two-1.0.jar", "libs/eartest-jar-sample-one-1.0.jar",
             "libs/eartest-jar-sample-two-1.0.jar", "sar-sample-one.sar"} );
+    }
+
+    /**
+     * Builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml if
+     * includeInApplicationXml is set.
+     */
+    public void testProject037()
+        throws Exception
+    {
+        doTestProject( "project-037", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0-client.jar"} );
     }
 
 }

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml?view=diff&rev=492260&r1=492259&r2=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml Wed Jan  3 11:24:55 2007
@@ -24,9 +24,6 @@
 <application>
   <display-name>maven-ear-plugin-test-project-030</display-name>
   <module>
-    <java>ejb-sample-two-1.0-client.jar</java>
-  </module>
-  <module>
     <ejb>ejb-sample-one-1.0.jar</ejb>
   </module>
 </application>

Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/expected-META-INF/application.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/expected-META-INF/application.xml?view=auto&rev=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/expected-META-INF/application.xml (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/expected-META-INF/application.xml Wed Jan  3 11:24:55 2007
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<!DOCTYPE application PUBLIC
+	"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+	"http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+  <display-name>maven-ear-plugin-test-project-037</display-name>
+  <module>
+    <java>ejb-sample-two-1.0-client.jar</java>
+  </module>
+  <module>
+    <ejb>ejb-sample-one-1.0.jar</ejb>
+  </module>
+</application>

Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/pom.xml?view=auto&rev=492260
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/pom.xml (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-037/pom.xml Wed Jan  3 11:24:55 2007
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>ear</groupId>
+  <artifactId>maven-ear-plugin-test-project-037</artifactId>
+  <version>99.0</version>
+  <name>Maven</name>
+  <packaging>ear</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-one</artifactId>
+      <version>1.0</version>
+      <type>ejb</type>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-two</artifactId>
+      <version>1.0</version>
+      <type>ejb-client</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <configuration>
+          <modules>
+            <ejbClientModule>
+              <groupId>eartest</groupId>
+              <artifactId>ejb-sample-two</artifactId>
+              <includeInApplicationXml>true</includeInApplicationXml>
+            </ejbClientModule>
+          </modules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>