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 2006/11/06 22:33:20 UTC

svn commit: r471886 - in /maven/plugins/trunk/maven-ear-plugin/src: main/java/org/apache/maven/plugin/ear/ site/apt/ site/apt/examples/ test/java/org/apache/maven/plugin/ear/ test/resources/m2repo/eartest/ejb-sample-two/1.0/ test/resources/projects/pro...

Author: snicoll
Date: Mon Nov  6 13:33:18 2006
New Revision: 471886

URL: http://svn.apache.org/viewvc?view=rev&rev=471886
Log:
MEAR-46: 
- Fixed ejb-clients handling
- Renamed JavaModule to JarModule and deprecated JavaModule
- Added defaultLibDir as an alias of defaultJavaBundleDir which is more understable
- Updated documentation
- Updated tests and added an ejb-client test.

Added:
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java   (with props)
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0-client.jar   (with props)
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml   (with props)
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml   (with props)
Modified:
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarExecutionContext.java
    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/EarMojo.java
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JavaModule.java
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-a-module-filename.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-location.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-uri.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/excluding-a-module.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/including-a-third-party-library-in-application-xml.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/unpacking-a-module.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/usage.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/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0.pom
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-004/pom.xml
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-005/pom.xml
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-006/pom.xml
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-021/pom.xml

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java Mon Nov  6 13:33:18 2006
@@ -34,6 +34,8 @@
 
     protected static final String MODULE_ELEMENT = "module";
 
+    protected static final String JAVA_MODULE = "java";
+
     private String uri;
 
     private Artifact artifact;

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java Mon Nov  6 13:33:18 2006
@@ -86,11 +86,11 @@
     protected PlexusConfiguration artifactTypeMappings;
 
     /**
-     * The default bundle dir for Java modules.
+     * The default bundle dir for libraries.
      *
-     * @parameter
+     * @parameter alias="defaultJavaBundleDir"
      */
-    private String defaultJavaBundleDir;
+    private String defaultLibBundleDir;
 
     /**
      * Directory that resources are copied to during the build.
@@ -142,7 +142,7 @@
         }
 
         getLog().debug( "Initializing ear execution context" );
-        EarExecutionContext.getInstance().initialize( defaultJavaBundleDir, jbossConfiguration );
+        EarExecutionContext.getInstance().initialize( defaultLibBundleDir, jbossConfiguration );
 
         getLog().debug( "Resolving ear modules ..." );
         allModules = new ArrayList();
@@ -181,7 +181,7 @@
                 if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional() &&
                     filter.include( artifact ) )
                 {
-                    EarModule module = EarModuleFactory.newEarModule( artifact, defaultJavaBundleDir );
+                    EarModule module = EarModuleFactory.newEarModule( artifact, defaultLibBundleDir );
                     allModules.add( module );
                 }
             }

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarExecutionContext.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarExecutionContext.java?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarExecutionContext.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarExecutionContext.java Mon Nov  6 13:33:18 2006
@@ -34,7 +34,7 @@
 
     // Singleton implementation
 
-    private String defaultJavaBundleDir;
+    private String defaultLibBundleDir;
 
     private JbossConfiguration jbossConfiguration;
 
@@ -43,9 +43,9 @@
 
     }
 
-    public String getDefaultJavaBundleDir()
+    public String getDefaultLibBundleDir()
     {
-        return defaultJavaBundleDir;
+        return defaultLibBundleDir;
     }
 
     public JbossConfiguration getJbossConfiguration()
@@ -58,9 +58,9 @@
         return jbossConfiguration != null;
     }
 
-    protected void initialize( String defaultJavaBundleDir, JbossConfiguration jbossConfiguration )
+    protected void initialize( String defaultLibBundleDir, JbossConfiguration jbossConfiguration )
     {
-        this.defaultJavaBundleDir = defaultJavaBundleDir;
+        this.defaultLibBundleDir = defaultLibBundleDir;
         this.jbossConfiguration = jbossConfiguration;
     }
 }

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=471886&r1=471885&r2=471886
==============================================================================
--- 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 Mon Nov  6 13:33:18 2006
@@ -52,10 +52,10 @@
      * execution configuration.
      *
      * @param artifact             the artifact
-     * @param defaultJavaBundleDir the default bundle dir for {@link JavaModule}
+     * @param defaultLibBundleDir the default bundle dir for {@link JarModule}
      * @return an ear module for this artifact
      */
-    public static EarModule newEarModule( Artifact artifact, String defaultJavaBundleDir )
+    public static EarModule newEarModule( Artifact artifact, String defaultLibBundleDir )
         throws UnknownArtifactTypeException
     {
         // Get the standard artifact type based on default config and user-defined mapping(s)
@@ -64,7 +64,7 @@
 
         if ( "jar".equals( artifactType ) )
         {
-            return new JavaModule( artifact, defaultJavaBundleDir );
+            return new JarModule( artifact, defaultLibBundleDir );
         }
         else if ( "ejb".equals( artifactType ) )
         {

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java Mon Nov  6 13:33:18 2006
@@ -187,6 +187,9 @@
             for ( Iterator iter = getModules().iterator(); iter.hasNext(); )
             {
                 EarModule module = (EarModule) iter.next();
+                if (module instanceof JavaModule) {
+                    getLog().warn( "JavaModule is deprecated ("+module+"), please use JarModule instead.");
+                }
                 final File sourceFile = module.getArtifact().getFile();
                 final File destinationFile = buildDestinationFile( getWorkDirectory(), module.getUri() );
                 if ( !sourceFile.isFile() )

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=471886&r1=471885&r2=471886
==============================================================================
--- 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 Mon Nov  6 13:33:18 2006
@@ -17,15 +17,16 @@
  */
 
 import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.xml.XMLWriter;
 
 /**
- * The {@link EarModule} implementation for an Ejb-client module.
+ * The {@link EarModule} implementation for an ejb client module.
  *
  * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
  * @version $Id$
  */
 public class EjbClientModule
-    extends JavaModule
+    extends AbstractEarModule
 {
 
     public EjbClientModule()
@@ -34,7 +35,16 @@
 
     public EjbClientModule( Artifact a )
     {
-        super( a, null );
+        super( a );
+    }
+
+    public void appendModule( XMLWriter writer, String version )
+    {
+        writer.startElement( MODULE_ELEMENT );
+        writer.startElement( JAVA_MODULE );
+        writer.writeText( getUri() );
+        writer.endElement();
+        writer.endElement();
     }
 
     public String getType()

Added: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java?view=auto&rev=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java Mon Nov  6 13:33:18 2006
@@ -0,0 +1,93 @@
+package org.apache.maven.plugin.ear;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoFailureException;
+import org.codehaus.plexus.util.xml.XMLWriter;
+
+import java.util.Set;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * The {@link EarModule} implementation for a non J2EE module such as
+ * third party libraries.
+ * <p/>
+ * Such module is not incorporated in the generated <tt>application.xml<tt>
+ * but some application servers support it. To include it in the generated
+ * deployment descriptor anyway, set the <tt>includeInApplicationXml</tt>
+ * boolean flag.
+ * <p/>
+ * This class deprecates {@link org.apache.maven.plugin.ear.JavaModule}.
+ *
+ * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
+ * @version $Id$
+ */
+public class JarModule
+    extends AbstractEarModule
+{
+    private Boolean includeInApplicationXml = Boolean.FALSE;
+
+    public JarModule()
+    {
+        super();
+    }
+
+    public JarModule( Artifact a, String defaultLibBundleDir )
+    {
+        super( a );
+        setLibBundleDir( defaultLibBundleDir );
+
+    }
+
+    public void appendModule( XMLWriter writer, String version )
+    {
+        // Generates an entry in the application.xml only if
+        // includeInApplicationXml is set
+        if ( includeInApplicationXml.booleanValue() )
+        {
+            writer.startElement( MODULE_ELEMENT );
+            writer.startElement( JAVA_MODULE );
+            writer.writeText( getUri() );
+            writer.endElement();
+            writer.endElement();
+        }
+    }
+
+    public void resolveArtifact( Set artifacts )
+        throws EarPluginException, MojoFailureException
+    {
+        // Let's resolve the artifact
+        super.resolveArtifact( artifacts );
+
+        // If the defaultLibBundleDir is set and no bundle dir is
+        // set, set the default as bundle dir
+        setLibBundleDir( EarExecutionContext.getInstance().getDefaultLibBundleDir() );
+    }
+
+    public String getType()
+    {
+        return "jar";
+    }
+
+    private void setLibBundleDir( String defaultLibBundleDir )
+    {
+        if ( defaultLibBundleDir != null && bundleDir == null )
+        {
+            this.bundleDir = defaultLibBundleDir;
+        }
+    }
+}

Propchange: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JarModule.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JavaModule.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JavaModule.java?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JavaModule.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/JavaModule.java Mon Nov  6 13:33:18 2006
@@ -17,71 +17,33 @@
  */
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.xml.XMLWriter;
-
-import java.util.Set;
 
 /**
- * The {@link EarModule} implementation for a J2EE client module.
+ * The original {@link org.apache.maven.plugin.ear.EarModule} implementation
+ * of a third party library.
  *
  * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
  * @version $Id$
+ * @deprecated the name JavaModule is really confusing since it targets a
+ *             third party library, use {@link JarModule} instead
  */
 public class JavaModule
-    extends AbstractEarModule
+    extends JarModule
 {
-    protected static final String JAVA_MODULE = "java";
-
-    private Boolean includeInApplicationXml = Boolean.FALSE;
 
+    /**
+     * @deprecated use {@link org.apache.maven.plugin.ear.JavaModule#JarModule()}  instead
+     */
     public JavaModule()
     {
-
-    }
-
-    public JavaModule( Artifact a, String defaultJavaBundleDir )
-    {
-        super( a );
-        setJavaBundleDir( defaultJavaBundleDir );
-
-    }
-
-    public void appendModule( XMLWriter writer, String version )
-    {
-        // Generates an entry in the application.xml only if
-        // includeInApplicationXml is set
-        if ( includeInApplicationXml.booleanValue() )
-        {
-            writer.startElement( MODULE_ELEMENT );
-            writer.startElement( JAVA_MODULE );
-            writer.writeText( getUri() );
-            writer.endElement();
-            writer.endElement();
-        }
-    }
-
-    public void resolveArtifact( Set artifacts )
-        throws EarPluginException, MojoFailureException
-    {
-        // Let's resolve the artifact
-        super.resolveArtifact( artifacts );
-
-        // If the defaultJavaBundleDir is set and no bundle dir is
-        // set, set the default as bundle dir
-        setJavaBundleDir( EarExecutionContext.getInstance().getDefaultJavaBundleDir() );
-    }
-
-    public String getType()
-    {
-        return "jar";
+        super();
     }
 
-    private void setJavaBundleDir( String defaultJavaBundleDir )
+    /**
+     * @deprecated use {@link org.apache.maven.plugin.ear.JavaModule#JarModule(org.apache.maven.artifact.Artifact,String)}} instead
+     */
+    public JavaModule( Artifact a, String defaultLibBundleDir )
     {
-        if ( defaultJavaBundleDir != null && bundleDir == null )
-        {
-            this.bundleDir = defaultJavaBundleDir;
-        }
+        super( a, defaultLibBundleDir );
     }
 }

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-a-module-filename.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-a-module-filename.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-a-module-filename.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-a-module-filename.apt Mon Nov  6 13:33:18 2006
@@ -37,11 +37,11 @@
         <configuration>
            [...]
            <modules>
-             <javaModule>
+             <ejbModule>
                <groupId>artifactGroupId</groupId>
                <artifactId>artifactId</artifactId>
                <bundleFileName>anotherName-1.2.3.jar</bundleFileName>
-             </javaModule>
+             </ejbModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-location.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-location.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-location.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-location.apt Mon Nov  6 13:33:18 2006
@@ -38,11 +38,11 @@
         <configuration>
            [...]
            <modules>
-             <javaModule>
+             <jarModule>
                <groupId>artifactGroupId</groupId>
                <artifactId>artifactId</artifactId>
                <bundleDir>APP-INF/lib</bundleDir>
-             </javaModule>
+             </jarModule>
           </modules>
         </configuration>
       </plugin>
@@ -50,9 +50,9 @@
   </build>
 +---------
 
-  Note that it is possible to specify a default bundle directory for all Java
-  modules. If a Java module has not the bundleDir property above, the default
-  one is used. Below is an example of such configuration:
+  Note that it is possible to specify a default bundle directory for all libraries.
+  If a Jar module has not the bundleDir property above, the default one is used.
+  Below is an example of such configuration:
 
 +--------
   <build>
@@ -62,13 +62,13 @@
         <artifactId>maven-ear-plugin</artifactId>
         <configuration>
            [...]
-           <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
+           <defaultLibBundleDir>APP-INF/lib</defaultLibBundleDir>
            <modules>
-             <javaModule>
+             <jarModule>
                <groupId>artifactGroupId</groupId>
                <artifactId>artifactId</artifactId>
                <bundleDir>/</bundleDir>
-             </javaModule>
+             </jarModule>
           </modules>
         </configuration>
       </plugin>
@@ -76,6 +76,5 @@
   </build>
 +---------
 
-  In the above case, Java modules will be placed in the APP-INF/lib directory
-  except the specified artifact which will be placed at the root of the EAR
-  structure.
+  In the above case, jar modules (i.e. libraries) will be placed in the APP-INF/lib directory
+  except the specified artifact which will be placed at the root of the EAR structure.

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-uri.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-uri.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-uri.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/customizing-module-uri.apt Mon Nov  6 13:33:18 2006
@@ -39,11 +39,11 @@
         <configuration>
            [...]
            <modules>
-             <javaModule>
+             <jarModule>
                <groupId>artifactGroupId</groupId>
                <artifactId>artifactId</artifactId>
                <uri>APP-INF/lib/anotherName-1.2.3.jar</uri>
-             </javaModule>
+             </jarModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/excluding-a-module.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/excluding-a-module.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/excluding-a-module.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/excluding-a-module.apt Mon Nov  6 13:33:18 2006
@@ -38,11 +38,11 @@
         <configuration>
            [...]
            <modules>
-             <javaModule>
+             <warModule>
                <groupId>artifactGroupId</groupId>
                <artifactId>artifactId</artifactId>
                <excluded>true</excluded>
-             </javaModule>
+             </warModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/including-a-third-party-library-in-application-xml.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/including-a-third-party-library-in-application-xml.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/including-a-third-party-library-in-application-xml.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/including-a-third-party-library-in-application-xml.apt Mon Nov  6 13:33:18 2006
@@ -27,7 +27,8 @@
 Including A Third Party Library In application.xml
 
   If third party libraries need to be included in the generated application.xml, the
-  'includeInApplicationXml' flag could be used. This flag works only for java modules.
+  'includeInApplicationXml' flag could be used. This flag works only for jar modules
+  since they define third party libraries packaged within the EAR.
 
 +--------
   <build>
@@ -38,11 +39,11 @@
         <configuration>
            [...]
            <modules>
-             <javaModule>
+             <jarModule>
                <groupId>artifactGroupId</groupId>
                <artifactId>artifactId</artifactId>
                <includeInApplicationXml>true</includeInApplicationXml>
-             </javaModule>
+             </jarModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/unpacking-a-module.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/unpacking-a-module.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/unpacking-a-module.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/unpacking-a-module.apt Mon Nov  6 13:33:18 2006
@@ -43,11 +43,11 @@
         <artifactId>maven-ear-plugin</artifactId>
         <configuration>
           <modules>
-            <javaModule>
+            <sarModule>
               <groupId>artifactGroupId</groupId>
               <artifactId>artifactId</artifactId>
               <unpack>true</unpack>
-            </javaModule>
+            </sarModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt Mon Nov  6 13:33:18 2006
@@ -34,7 +34,7 @@
 
   * {{{#ejbModule}ejbModule}}
 
-  * {{{#javaModule}javaModule}}
+  * {{{#jarModule}jarModule}} (previously know as javaModule and deprecated)
 
   * {{{#parModule}parModule}}
 
@@ -165,18 +165,18 @@
   to its uri. Default is false.
 
 
-* {javaModule} Properties
+* {jarModule} Properties
 
-  The following configuration options are available for JavaModule:
+  The following configuration options are available for JarModule:
 
-  * <<groupId>> - sets the groupId of the java artifact you want to
+  * <<groupId>> - sets the groupId of the jar artifact you want to
   configure.
 
-  * <<artifactId>> - sets the artifactId of the java artifact you want to
+  * <<artifactId>> - sets the artifactId of the jar artifact you want to
   configure.
 
-  * <<classifier>> - sets the classifier of the java artifact you want to
-  configure if multiple java artifacts matches the groupId/artifact.
+  * <<classifier>> - sets the classifier of the jar artifact you want to
+  configure if multiple jar artifacts matches the groupId/artifact.
 
   * <<bundleDir>> - sets the location of this artifact inside the ear archive.
   If not set, this artifact will be packaged in the root of the archive.

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=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt Mon Nov  6 13:33:18 2006
@@ -88,6 +88,8 @@
 
   * 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
+
   
 
    

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/usage.apt?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/usage.apt Mon Nov  6 13:33:18 2006
@@ -86,10 +86,10 @@
   The context root of a Web module might be customized using the contextRoot
   parameter.
 
-  Please note that third party libraries are not included in the generated
-  application.xml (only ejb-client should be included in a <java> entry).
-  However, a jar dependency could be included in the generated application.xml
-  by specifying the <<<includeInApplicationXml>>> flag.
+  Please note that third party libraries (i.e. JarModule) are not included
+  in the generated application.xml (only ejb-client should be included in
+  a <java> entry). However, a jar dependency could be included in the
+  generated application.xml by specifying the <<<includeInApplicationXml>>> flag.
 
   It is also possible to specify a default bundle directory for all third party
   libraries.

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=471886&r1=471885&r2=471886
==============================================================================
--- 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 Mon Nov  6 13:33:18 2006
@@ -211,7 +211,8 @@
     public void testProject019()
         throws Exception
     {
-        doTestProject( "project-019", new String[]{"ejb-sample-one-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar"},
+        doTestProject( "project-019",
+                       new String[]{"ejb-sample-one-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar"},
                        new boolean[]{false, true, true} );
     }
 
@@ -221,7 +222,8 @@
     public void testProject020()
         throws Exception
     {
-        doTestProject( "project-020", new String[]{"ejb-sample-one-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar"},
+        doTestProject( "project-020",
+                       new String[]{"ejb-sample-one-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar"},
                        new boolean[]{true, false, false} );
     }
 
@@ -233,7 +235,7 @@
     {
         doTestProject( "project-021", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar",
             "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar", "jar-sample-two-1.0.jar"},
-                       new boolean[]{false, true, false, false, true} );
+                                      new boolean[]{false, true, false, false, true} );
     }
 
     /**
@@ -283,12 +285,12 @@
     public void testProject026()
         throws Exception
     {
-        final File baseDir = executeMojo( "project-026", new Properties( ), false);
+        final File baseDir = executeMojo( "project-026", new Properties(), false );
         // Stupido, checks that the ear archive is not there
-        assertFalse("Execution should have failed", getEarArchive(baseDir, "project-026").exists());
+        assertFalse( "Execution should have failed", getEarArchive( baseDir, "project-026" ).exists() );
     }
 
-     /**
+    /**
      * Builds an EAR and make sure that provided dependencies are not included in the EAR.
      */
     public void testProject027()
@@ -306,13 +308,22 @@
         doTestProject( "project-028", new String[]{"ejb-sample-one-1.0.jar"} );
     }
 
-     /**
+    /**
      * Builds an EAR and make sure that system dependencies are not included in the EAR.
      */
     public void testProject029()
         throws Exception
     {
         doTestProject( "project-029", new String[]{"ejb-sample-one-1.0.jar"} );
+    }
+
+     /**
+     * Builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml.
+     */
+    public void testProject030()
+        throws Exception
+    {
+        doTestProject( "project-030", new String[]{"ejb-sample-one-1.0.jar","ejb-sample-two-1.0-client.jar"} );
     }
 
 }

Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0-client.jar
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0-client.jar?view=auto&rev=471886
==============================================================================
Binary file - no diff available.

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0-client.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0.pom
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0.pom?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0.pom (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0.pom Mon Nov  6 13:33:18 2006
@@ -7,4 +7,14 @@
   <distributionManagement>
     <status>verified</status>
   </distributionManagement>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-ejb-plugin</artifactId>
+        <configuration>
+          <generateClient>true</generateClient>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-004/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-004/pom.xml?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-004/pom.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-004/pom.xml Mon Nov  6 13:33:18 2006
@@ -31,13 +31,13 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-ear-plugin</artifactId>
         <configuration>
-          <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
+          <defaultLibBundleDir>APP-INF/lib</defaultLibBundleDir>
           <modules>
-            <javaModule>
+            <jarModule>
               <groupId>eartest</groupId>
               <artifactId>jar-sample-one</artifactId>
               <bundleDir>/</bundleDir>
-            </javaModule>
+            </jarModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-005/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-005/pom.xml?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-005/pom.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-005/pom.xml Mon Nov  6 13:33:18 2006
@@ -26,13 +26,13 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-ear-plugin</artifactId>
         <configuration>
-          <defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
+          <defaultLibBundleDir>APP-INF/lib</defaultLibBundleDir>
           <modules>
-            <javaModule>
+            <jarModule>
               <groupId>eartest</groupId>
               <artifactId>jar-sample-one</artifactId>
               <uri>libs/another-name.jar</uri>
-            </javaModule>
+            </jarModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-006/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-006/pom.xml?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-006/pom.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-006/pom.xml Mon Nov  6 13:33:18 2006
@@ -32,11 +32,11 @@
         <artifactId>maven-ear-plugin</artifactId>
         <configuration>          
           <modules>
-            <javaModule>
+            <jarModule>
               <groupId>eartest</groupId>
               <artifactId>jar-sample-one</artifactId>
               <excluded>true</excluded>
-            </javaModule>
+            </jarModule>
           </modules>
         </configuration>
       </plugin>

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-021/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-021/pom.xml?view=diff&rev=471886&r1=471885&r2=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-021/pom.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-021/pom.xml Mon Nov  6 13:33:18 2006
@@ -50,11 +50,11 @@
               <artifactId>ejb-sample-one</artifactId>
               <unpack>false</unpack>
             </ejbModule>
-            <javaModule>
+            <jarModule>
               <groupId>eartest</groupId>
               <artifactId>jar-sample-one</artifactId>
               <unpack>false</unpack>
-            </javaModule>
+            </jarModule>
           </modules>
         </configuration>
       </plugin>

Added: 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=auto&rev=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml Mon Nov  6 13:33:18 2006
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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-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>

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/expected-META-INF/application.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml?view=auto&rev=471886
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml Mon Nov  6 13:33:18 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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-030</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>
+</project>

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-030/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision