You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2020/12/26 13:36:09 UTC

[maven-ear-plugin] branch master updated: [MEAR-166] Handling EAR modules of all types when modifying Class-Path and when skinnyWars / skinnyModules is used (#33)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new b40df73  [MEAR-166] Handling EAR modules of all types when modifying Class-Path and when skinnyWars / skinnyModules is used (#33)
b40df73 is described below

commit b40df73645a18cecde1c68cbed5fa8f37f9e949d
Author: Marat Abrarov <ab...@gmail.com>
AuthorDate: Sat Dec 26 16:35:59 2020 +0300

    [MEAR-166] Handling EAR modules of all types when modifying Class-Path and when skinnyWars / skinnyModules is used (#33)
    
    * [MEAR-166] - Removing EAR modules of all types when skinnyWars / skinnyModules is on. Updating reference to the EAR modules of all types in the Class-Path entry of MANIFEST.mf when modifying that entry.
    
    * [MEAR-166] - Fixed typo and wording in documentation and JavaDoc.
    
    * [MEAR-166] - Removal of Java 6 legacy and replacement of class with primitive type where primitive type is sufficient.
---
 .../maven/plugins/ear/AbstractEarModule.java       |  41 ++++---
 .../apache/maven/plugins/ear/AbstractEarMojo.java  |  38 +++----
 .../org/apache/maven/plugins/ear/EarModule.java    |  13 +++
 .../java/org/apache/maven/plugins/ear/EarMojo.java |  60 ++++++----
 .../org/apache/maven/plugins/ear/JarModule.java    |   3 +-
 src/site/apt/index.apt.vm                          |   5 +-
 src/site/apt/modules.apt.vm                        | 107 +++++++++++++++++
 .../org/apache/maven/plugins/ear/it/EarMojoIT.java |  68 +++++++++++
 .../ear/expected-META-INF/application.xml          |  38 +++++++
 .../resources/projects/project-098/ear/pom.xml     |  95 ++++++++++++++++
 .../resources/projects/project-098/ejb-one/pom.xml |  64 +++++++++++
 .../ejb-one/src/main/java/eartest/Stub.java        |  22 ++++
 .../resources/projects/project-098/ejb-two/pom.xml |  55 +++++++++
 .../ejb-two/src/main/java/eartest/Stub.java        |  22 ++++
 src/test/resources/projects/project-098/pom.xml    | 126 +++++++++++++++++++++
 .../resources/projects/project-098/rar/pom.xml     |  59 ++++++++++
 .../project-098/rar/src/main/rar/META-INF/ra.xml   |  23 ++++
 .../project-098/rar/src/main/rar/SomeResource.txt  |  16 +++
 .../resources/projects/project-098/war/pom.xml     |  64 +++++++++++
 .../war/src/main/webapp/WEB-INF/web.xml            |  24 ++++
 20 files changed, 874 insertions(+), 69 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java b/src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
index bb64744..2186b56 100644
--- a/src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
+++ b/src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
@@ -101,6 +101,16 @@ public abstract class AbstractEarModule
      */
     protected String libDirectory;
 
+    /**
+     * If module is considered for inclusion into the Class-Path entry of MANIFEST.mf of other modules. {@code false}
+     * value leads to removal of the module from the Class-Path entry. {@code true} value leads to modification of the
+     * reference to the module in the Class-Path entry if such reference exists or leads to adding of the module into
+     * the Class-Path entry if such reference doesn't exist. Removal, modification or adding of the reference in the
+     * Class-Path entry depends on libDirectory property of another module and on skinnyWars / skinnyModules parameters
+     * of EAR Plugin.
+     */
+    protected boolean classPathItem;
+
     // This is injected once the module has been built.
 
     /**
@@ -264,9 +274,15 @@ public abstract class AbstractEarModule
     }
 
     /**
-     * Returns the bundle file name. If null, the artifact's file name is returned.
-     * 
-     * @return the bundle file name
+     * {@inheritDoc}
+     */
+    public boolean isClassPathItem()
+    {
+        return classPathItem;
+    }
+
+    /**
+     * {@inheritDoc}
      */
     public String getBundleFileName()
     {
@@ -416,25 +432,6 @@ public abstract class AbstractEarModule
     }
 
     /**
-     * Specify if the objects are both null or both equal.
-     * 
-     * @param first the first object
-     * @param second the second object
-     * @return true if parameters are either both null or equal
-     */
-    static boolean areNullOrEqual( Object first, Object second )
-    {
-        if ( first != null )
-        {
-            return first.equals( second );
-        }
-        else
-        {
-            return second == null;
-        }
-    }
-
-    /**
      * Sets the URI of the module explicitly for testing purposes.
      * 
      * @param uri the uri
diff --git a/src/main/java/org/apache/maven/plugins/ear/AbstractEarMojo.java b/src/main/java/org/apache/maven/plugins/ear/AbstractEarMojo.java
index e7083f6..db4be30 100644
--- a/src/main/java/org/apache/maven/plugins/ear/AbstractEarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/ear/AbstractEarMojo.java
@@ -167,9 +167,9 @@ public abstract class AbstractEarMojo
 
     private List<EarModule> earModules;
 
-    private List<JarModule> allJarModules;
+    private List<EarModule> allEarModules;
 
-    private List<JarModule> providedJarModules;
+    private List<EarModule> providedEarModules;
 
     private JbossConfiguration jbossConfiguration;
 
@@ -272,9 +272,9 @@ public abstract class AbstractEarMojo
 
         // Now we have everything let's built modules which have not been excluded
         ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
-        allJarModules = new ArrayList<JarModule>();
-        providedJarModules = new ArrayList<JarModule>();
-        earModules = new ArrayList<EarModule>();
+        allEarModules = new ArrayList<>();
+        providedEarModules = new ArrayList<>();
+        earModules = new ArrayList<>();
         for ( EarModule earModule : allModules )
         {
             if ( earModule.isExcluded() )
@@ -283,18 +283,14 @@ public abstract class AbstractEarMojo
             }
             else
             {
-                boolean isJarModule = earModule instanceof JarModule;
-                if ( isJarModule )
-                {
-                    allJarModules.add( (JarModule) earModule );
-                }
+                allEarModules.add( earModule );
                 if ( filter.include( earModule.getArtifact() ) )
                 {
                     earModules.add( earModule );
                 }
-                else if ( isJarModule )
+                else
                 {
-                    providedJarModules.add( (JarModule) earModule );
+                    providedEarModules.add( earModule );
                 }
             }
         }
@@ -314,27 +310,27 @@ public abstract class AbstractEarMojo
     }
 
     /**
-     * @return The list of {@link #allJarModules}. This corresponds to all JAR modules (compile + runtime).
+     * @return The list of {@link #allEarModules}. This corresponds to all modules (provided + compile + runtime).
      */
-    protected List<JarModule> getAllJarModules()
+    protected List<EarModule> getAllEarModules()
     {
-        if ( allJarModules == null )
+        if ( allEarModules == null )
         {
-            throw new IllegalStateException( "Jar modules have not been initialized" );
+            throw new IllegalStateException( "EAR modules have not been initialized" );
         }
-        return allJarModules;
+        return allEarModules;
     }
 
     /**
-     * @return the list of {@link #providedJarModules}. This corresponds to provided JAR modules.
+     * @return the list of {@link #providedEarModules}. This corresponds to provided modules.
      */
-    protected List<JarModule> getProvidedJarModules()
+    protected List<EarModule> getProvidedEarModules()
     {
-        if ( providedJarModules == null )
+        if ( providedEarModules == null )
         {
             throw new IllegalStateException( "Jar modules have not been initialized" );
         }
-        return providedJarModules;
+        return providedEarModules;
     }
 
     /**
diff --git a/src/main/java/org/apache/maven/plugins/ear/EarModule.java b/src/main/java/org/apache/maven/plugins/ear/EarModule.java
index 4c9324a..4efd962 100644
--- a/src/main/java/org/apache/maven/plugins/ear/EarModule.java
+++ b/src/main/java/org/apache/maven/plugins/ear/EarModule.java
@@ -119,4 +119,17 @@ public interface EarModule
      */
     String getLibDir();
 
+    /**
+     * Returns the bundle file name. If {@code null}, the artifact's file name is returned.
+     *
+     * @return the bundle file name
+     */
+    String getBundleFileName();
+
+    /**
+     * If module should be included into the Class-Path entry of MANIFEST.mf. Doesn't impact Class-Path entry of
+     * MANIFEST.mf of modules which contain all of their dependencies unless skinnyWars / skinnyModules is turned on.
+     */
+    boolean isClassPathItem();
+
 }
diff --git a/src/main/java/org/apache/maven/plugins/ear/EarMojo.java b/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
index 0ffdd6f..3713c19 100644
--- a/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
@@ -839,9 +839,13 @@ public class EarMojo
 
             if ( ( moduleLibDir != null ) && ( skinnyModules || ( skinnyWars && module instanceof WebModule ) ) )
             {
-                // Remove JAR modules
-                for ( JarModule jm : getAllJarModules() )
+                // Remove modules
+                for ( EarModule otherModule : getAllEarModules() )
                 {
+                    if ( module.equals( otherModule ) )
+                    {
+                        continue;
+                    }
                     // MEAR-189:
                     // We use the original name, cause in case of outputFileNameMapping
                     // we could not not delete it and it will end up in the resulting EAR and the WAR
@@ -856,34 +860,35 @@ public class EarMojo
                     if ( !artifact.exists() )
                     {
                         getLog().debug( "module does not exist with original file name." );
-                        artifact = new File( workLibDir, jm.getBundleFileName() );
+                        artifact = new File( workLibDir, otherModule.getBundleFileName() );
                         getLog().debug( "Artifact with mapping: " + artifact.getAbsolutePath() );
                     }
 
                     if ( !artifact.exists() )
                     {
                         getLog().debug( "Artifact with mapping does not exist." );
-                        artifact = new File( workLibDir, jm.getArtifact().getFile().getName() );
+                        artifact = new File( workLibDir, otherModule.getArtifact().getFile().getName() );
                         getLog().debug( "Artifact with original file name: " + artifact.getAbsolutePath() );
                     }
 
                     if ( !artifact.exists() )
                     {
                         getLog().debug( "Artifact with original file name does not exist." );
-                        final Artifact jmArtifact = jm.getArtifact();
-                        if ( jmArtifact.isSnapshot() )
+                        final Artifact otherModuleArtifact = otherModule.getArtifact();
+                        if ( otherModuleArtifact.isSnapshot() )
                         {
                             try
                             {
-                                artifact = new File( workLibDir, MappingUtils
-                                    .evaluateFileNameMapping( ARTIFACT_DEFAULT_FILE_NAME_MAPPING, jmArtifact ) );
+                                artifact = new File( workLibDir, MappingUtils.evaluateFileNameMapping(
+                                        ARTIFACT_DEFAULT_FILE_NAME_MAPPING, otherModuleArtifact ) );
                                 getLog()
                                     .debug( "Artifact with default mapping file name: " + artifact.getAbsolutePath() );
                             }
                             catch ( InterpolationException e )
                             {
-                                getLog().warn( "Failed to evaluate file name for [" + jm + "] module using mapping: "
-                                    + ARTIFACT_DEFAULT_FILE_NAME_MAPPING );
+                                getLog().warn(
+                                    "Failed to evaluate file name for [" + otherModule + "] module using mapping: "
+                                        + ARTIFACT_DEFAULT_FILE_NAME_MAPPING );
                             }
                         }
                     }
@@ -900,28 +905,37 @@ public class EarMojo
             }
 
             // Modify the classpath entries in the manifest
-            boolean forceClassPathModification = javaEEVersion.lt( JavaEEVersion.FIVE ) || defaultLibBundleDir == null;
-            for ( EarModule o : getModules() )
+            final boolean forceClassPathModification =
+                javaEEVersion.lt( JavaEEVersion.FIVE ) || defaultLibBundleDir == null;
+            final boolean classPathExtension = !skipClassPathModification || forceClassPathModification;
+            for ( EarModule otherModule : getModules() )
             {
-                if ( o instanceof JarModule )
+                if ( module.equals( otherModule ) )
                 {
-                    JarModule jm = (JarModule) o;
-                    final int moduleClassPathIndex = findModuleInClassPathElements( classPathElements, jm );
-                    if ( moduleClassPathIndex != -1 )
+                    continue;
+                }
+                final int moduleClassPathIndex = findModuleInClassPathElements( classPathElements, otherModule );
+                if ( moduleClassPathIndex != -1 )
+                {
+                    if ( otherModule.isClassPathItem() )
                     {
-                        classPathElements.set( moduleClassPathIndex, jm.getUri() );
+                        classPathElements.set( moduleClassPathIndex, otherModule.getUri() );
                     }
-                    else if ( !skipClassPathModification || forceClassPathModification )
+                    else
                     {
-                        classPathElements.add( jm.getUri() );
+                        classPathElements.remove( moduleClassPathIndex );
                     }
                 }
+                else if ( otherModule.isClassPathItem() && classPathExtension )
+                {
+                    classPathElements.add( otherModule.getUri() );
+                }
             }
 
-            // Remove provided Jar modules from classpath
-            for ( JarModule jm : getProvidedJarModules() )
+            // Remove provided modules from classpath
+            for ( EarModule otherModule : getProvidedEarModules() )
             {
-                final int moduleClassPathIndex = findModuleInClassPathElements( classPathElements, jm );
+                final int moduleClassPathIndex = findModuleInClassPathElements( classPathElements, otherModule );
                 if ( moduleClassPathIndex != -1 )
                 {
                     classPathElements.remove( moduleClassPathIndex );
@@ -1022,7 +1036,7 @@ public class EarMojo
      * @return -1 if {@code module} was not found in {@code classPathElements} or index of item of
      * {@code classPathElements} which matches {@code module}
      */
-    private int findModuleInClassPathElements( final List<String> classPathElements, final JarModule module )
+    private int findModuleInClassPathElements( final List<String> classPathElements, final EarModule module )
     {
         if ( classPathElements.isEmpty() )
         {
diff --git a/src/main/java/org/apache/maven/plugins/ear/JarModule.java b/src/main/java/org/apache/maven/plugins/ear/JarModule.java
index 9f9f318..ccdef84 100644
--- a/src/main/java/org/apache/maven/plugins/ear/JarModule.java
+++ b/src/main/java/org/apache/maven/plugins/ear/JarModule.java
@@ -51,6 +51,7 @@ public class JarModule
     public JarModule()
     {
         this.type = DEFAULT_ARTIFACT_TYPE;
+        this.classPathItem = true;
     }
 
     /**
@@ -63,7 +64,7 @@ public class JarModule
         super( a );
         setLibBundleDir( defaultLibBundleDir );
         this.includeInApplicationXml = includeInApplicationXml;
-
+        this.classPathItem = true;
     }
 
     /**
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index 9b24c40..43f8f80 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -65,8 +65,9 @@ ${project.name}
 
 * Version 3.2.0
 
-  {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter and libDirectory property
-  of EAR modules have been implemented.
+  {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter, <<<libDirectory>>> property
+  of EAR modules, <<<type>>> property of EAR modules and <<<classPathItem>>> property of
+  EAR modules have been implemented.
 
 * Version 3.0.0
 
diff --git a/src/site/apt/modules.apt.vm b/src/site/apt/modules.apt.vm
index e0f8362..488f9a9 100644
--- a/src/site/apt/modules.apt.vm
+++ b/src/site/apt/modules.apt.vm
@@ -141,6 +141,13 @@ EAR Modules
   setting in module <<<MANIFEST.MF>>> is modified and libraries of module located in
   <<<libDirectory>>> and matching libraries of EAR are removed from module.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is true. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {ejbModule} Properties
 
@@ -180,6 +187,13 @@ EAR Modules
 
   * <<libDirectory>> - refer to the same name property of {{{ejbClientModule}ejbClientModule}}.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {jarModule} Properties
 
@@ -220,6 +234,50 @@ EAR Modules
   * <<includeInApplicationXml>> - set to true to if you want to generate an entry
   of this module in <<<application.xml>>>. Default is false.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is true.
+
+  The module is removed from the <<<Class-Path>>> setting of <<<MANIFEST.MF>>> of another module
+  if the <<<classPathItem>>> property is false and one of the following conditions is met:
+
+    * Another module doesn't contain all of its dependencies (refer to the <<<libDirectory>>>
+    property of particular module type).
+
+    * {{{./ear-mojo.html#skinnyWars}skinnyWars}} parameter is true and another module is
+    a {{{webModule}webModule}}.
+
+    * {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter is true.
+
+  Existing reference to the module in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of another module is updated to match location of the module in EAR if
+  the <<<classPathItem>>> property is true and one of the following conditions is met:
+
+    * Another module doesn't contain all of its dependencies (refer to the <<<libDirectory>>>
+    property of particular module type).
+
+    * {{{./ear-mojo.html#skinnyWars}skinnyWars}} parameter is true and another module is
+    a {{{webModule}webModule}}.
+
+    * {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter is true.
+
+  The module is added into the <<<Class-Path>>> setting of another module
+  if the <<<classPathItem>>> is true, there is no existing reference to the module
+  in the <<<Class-Path>>> setting and one of the following conditions is met:
+
+    * {{{./ear-mojo.html#skinnyWars}skinnyWars}} parameter is true, another module is
+    a {{{webModule}webModule}} and one of the following conditions is met:
+
+      * {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter is false.
+
+      * {{{./ear-mojo.html#version}version}} parameter is less than 5.
+
+    * {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter is true and
+    one of the following conditions is met:
+
+      * {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter is false.
+
+      * {{{./ear-mojo.html#version}version}} parameter is less than 5.
+
 
 * {parModule} Properties
 
@@ -261,6 +319,13 @@ EAR Modules
 
   * <<libDirectory>> - refer to the same name property of {{{ejbClientModule}ejbClientModule}}.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {rarModule} Properties
 
@@ -303,6 +368,13 @@ EAR Modules
   at the root of archive. Refer to the same name property of
   {{{ejbClientModule}ejbClientModule}} for details.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {sarModule} Properties
 
@@ -343,6 +415,13 @@ EAR Modules
   packaged into archive. Default is 'lib'. Refer to the same name property of
   {{{ejbClientModule}ejbClientModule}} for details.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {webModule} Properties
 
@@ -391,6 +470,13 @@ EAR Modules
   setting in module <<<MANIFEST.MF>>> is modified and libraries of module located in
   <<<libDirectory>>> and matching libraries of EAR are removed from module.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {wsrModule} Properties
 
@@ -432,6 +518,13 @@ EAR Modules
   packaged into archive. Default is 'lib'. Refer to the same name property of
   {{{ejbClientModule}ejbClientModule}} for details.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {harModule} Properties
 
@@ -470,6 +563,13 @@ EAR Modules
   packaged into archive. Default is 'lib'. Refer to the same name property of
   {{{ejbClientModule}ejbClientModule}} for details.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * {appClientModule} Properties
 
@@ -507,6 +607,13 @@ EAR Modules
 
   * <<moduleId>> - sets the id of the module in the generated application.xml.
 
+  * <<classPathItem>> - defines if the module is an element of the <<<Class-Path>>> setting
+  of <<<MANIFEST.MF>>> of other modules. Default is false. Refer to the <<<classPathItem>>>
+  property of {{{jarModule}jarModule}} for the cases when the module is removed from
+  the <<<Class-Path>>> setting or added into the <<<Class-Path>>> setting or existing
+  reference to the module is updated in the <<<Class-Path>>> setting of <<<MANIFEST.MF>>>
+  of other modules.
+
 
 * Adding {Custom Artifact Types}
 
diff --git a/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java b/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
index 3bd317c..af49067 100644
--- a/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
+++ b/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
@@ -1232,4 +1232,72 @@ public class EarMojoIT
         final boolean[] artifactsDirectory = { false, false, false, false };
         doTestProject( "project-097", "ear", artifacts, artifactsDirectory, null, null, null , true );
     }
+
+    /**
+     * Ensures that when skinnyModules option is turned on then
+     * <ul>
+     * <li>EAR module whose classPathItem property is {@code false} is removed from the Class-Path entry of
+     * MANIFEST.mf of other modules</li>
+     * <li>EAR module whose classPathItem property is {@code true} is added into the Class-Path entry of MANIFEST.mf
+     * or existing reference is updated to match location of the module</li>
+     * <li>EAR module is removed from WARs and RARs (from modules which include their dependencies)</li>
+     * </ul>
+     */
+    public void testProject098()
+        throws Exception
+    {
+        final String projectName = "project-098";
+        final String earModuleName = "ear";
+        final String jarSampleOneLibrary = "jar-sample-one-1.0.jar";
+        final String jarSampleTwoLibrary = "jar-sample-two-1.0.jar";
+        final String jarSampleThreeLibrary = "jar-sample-three-with-deps-1.0.jar";
+        final String ejbFourClientLibrary = "ejb-sample-four-1.0-client.jar";
+        final String jarSampleOneEarLibrary = "lib/eartest-" + jarSampleOneLibrary;
+        final String jarSampleTwoEarLibrary = "lib/eartest-" + jarSampleTwoLibrary;
+        final String jarSampleThreeEarLibrary = "lib/eartest-" + jarSampleThreeLibrary;
+        final String ejbFourClientEarLibrary = "lib/eartest-" + ejbFourClientLibrary;
+        final String ejbThreeLibrary = "ejb-sample-three-1.0.jar";
+        final String ejbFourLibrary = "ejb-sample-four-1.0.jar";
+        final String ejbThreeModule = "eartest-" + ejbThreeLibrary;
+        final String ejbFourModule = "eartest-" + ejbFourLibrary;
+        final String rarLibrary = "rar-sample-one-1.0.rar";
+        final String rarModule = "eartest-" + rarLibrary;
+        final String warModule = "eartest-war-sample-three-1.0.war";
+        final String[] earModules = { ejbThreeModule, ejbFourModule, rarModule, warModule };
+        final boolean[] earModuleDirectory = { false, false, false, false };
+        final String warModuleLibDir = "WEB-INF/lib/";
+        final String rarModuleLibDir = "";
+
+        final File baseDir = doTestProject( projectName, earModuleName,
+            new String[] { ejbThreeModule, ejbFourModule, rarModule, warModule,
+                jarSampleOneEarLibrary, jarSampleTwoEarLibrary, jarSampleThreeEarLibrary, ejbFourClientEarLibrary },
+            new boolean[] { false, false, false, false, false, false, false, false },
+            earModules, earModuleDirectory,
+            new String[][] {
+                { jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, ejbFourClientEarLibrary, jarSampleOneEarLibrary },
+                { jarSampleOneEarLibrary, jarSampleTwoEarLibrary, jarSampleThreeEarLibrary, ejbFourClientEarLibrary },
+                { jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, jarSampleOneEarLibrary, ejbFourClientEarLibrary },
+                { jarSampleOneEarLibrary, jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, ejbFourClientEarLibrary } },
+            true );
+
+        assertEarModulesContent( baseDir, projectName, earModuleName, earModules, earModuleDirectory,
+            new String[][] { null, null, null, { warModuleLibDir } },
+            new String[][] { null, null,
+                {
+                    rarModuleLibDir + jarSampleTwoLibrary,
+                    rarModuleLibDir + jarSampleThreeLibrary,
+                    rarModuleLibDir + ejbFourLibrary,
+                    rarModuleLibDir + ejbFourClientLibrary,
+                },
+                {
+                    warModuleLibDir + jarSampleOneLibrary,
+                    rarModuleLibDir + jarSampleThreeLibrary,
+                    rarModuleLibDir + jarSampleTwoLibrary,
+                    warModuleLibDir + ejbThreeLibrary,
+                    warModuleLibDir + ejbFourLibrary,
+                    warModuleLibDir + ejbFourClientLibrary,
+                    warModuleLibDir + rarLibrary,
+                    warModuleLibDir + rarLibrary
+                } } );
+    }
 }
diff --git a/src/test/resources/projects/project-098/ear/expected-META-INF/application.xml b/src/test/resources/projects/project-098/ear/expected-META-INF/application.xml
new file mode 100644
index 0000000..a7a9475
--- /dev/null
+++ b/src/test/resources/projects/project-098/ear/expected-META-INF/application.xml
@@ -0,0 +1,38 @@
+<?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.
+-->
+<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
+  <display-name>maven-ear-plugin-test-project-098</display-name>
+  <module>
+    <ejb>eartest-ejb-sample-three-1.0.jar</ejb>
+  </module>
+  <module>
+    <ejb>eartest-ejb-sample-four-1.0.jar</ejb>
+  </module>
+  <module>
+    <connector>eartest-rar-sample-one-1.0.rar</connector>
+  </module>
+  <module>
+    <web>
+      <web-uri>eartest-war-sample-three-1.0.war</web-uri>
+      <context-root>/war-sample-three</context-root>
+    </web>
+  </module>
+  <library-directory>lib</library-directory>
+</application>
diff --git a/src/test/resources/projects/project-098/ear/pom.xml b/src/test/resources/projects/project-098/ear/pom.xml
new file mode 100644
index 0000000..f4675b6
--- /dev/null
+++ b/src/test/resources/projects/project-098/ear/pom.xml
@@ -0,0 +1,95 @@
+<?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>
+  <parent>
+    <groupId>ear</groupId>
+    <artifactId>maven-ear-plugin-test-project-098-parent</artifactId>
+    <version>99.0</version>
+  </parent>
+  <artifactId>maven-ear-plugin-test-project-098</artifactId>
+  <packaging>ear</packaging>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.jboss.spec.javax.servlet</groupId>
+        <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+        <version>${jboss-servlet-api_3.0_spec.version}</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.spec.javax.ejb</groupId>
+        <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+        <version>${jboss-ejb-api_3.1_spec.version}</version>
+        <scope>provided</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-one</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-two</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-three-with-deps</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-three</artifactId>
+      <type>ejb</type>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-four</artifactId>
+      <type>ejb</type>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>rar-sample-one</artifactId>
+      <type>rar</type>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>war-sample-three</artifactId>
+      <type>war</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <version>6</version>
+          <defaultLibBundleDir>lib</defaultLibBundleDir>
+          <skinnyModules>true</skinnyModules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/test/resources/projects/project-098/ejb-one/pom.xml b/src/test/resources/projects/project-098/ejb-one/pom.xml
new file mode 100644
index 0000000..bb4c723
--- /dev/null
+++ b/src/test/resources/projects/project-098/ejb-one/pom.xml
@@ -0,0 +1,64 @@
+<?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>
+  <parent>
+    <groupId>ear</groupId>
+    <artifactId>maven-ear-plugin-test-project-098-parent</artifactId>
+    <version>99.0</version>
+  </parent>
+  <groupId>eartest</groupId>
+  <artifactId>ejb-sample-three</artifactId>
+  <version>1.0</version>
+  <packaging>ejb</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.spec.javax.ejb</groupId>
+      <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-three-with-deps</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-four</artifactId>
+      <type>ejb-client</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ejb-plugin</artifactId>
+        <configuration>
+          <ejbVersion>3.1</ejbVersion>
+          <archive>
+            <manifest>
+              <addClasspath>true</addClasspath>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/test/resources/projects/project-098/ejb-one/src/main/java/eartest/Stub.java b/src/test/resources/projects/project-098/ejb-one/src/main/java/eartest/Stub.java
new file mode 100644
index 0000000..b8b0059
--- /dev/null
+++ b/src/test/resources/projects/project-098/ejb-one/src/main/java/eartest/Stub.java
@@ -0,0 +1,22 @@
+package eartest;
+
+/*
+ * 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.
+ */
+
+public class Stub {}
diff --git a/src/test/resources/projects/project-098/ejb-two/pom.xml b/src/test/resources/projects/project-098/ejb-two/pom.xml
new file mode 100644
index 0000000..9b3f271
--- /dev/null
+++ b/src/test/resources/projects/project-098/ejb-two/pom.xml
@@ -0,0 +1,55 @@
+<?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>
+  <parent>
+    <groupId>ear</groupId>
+    <artifactId>maven-ear-plugin-test-project-098-parent</artifactId>
+    <version>99.0</version>
+  </parent>
+  <groupId>eartest</groupId>
+  <artifactId>ejb-sample-four</artifactId>
+  <version>1.0</version>
+  <packaging>ejb</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.spec.javax.ejb</groupId>
+      <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-two</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ejb-plugin</artifactId>
+        <configuration>
+          <ejbVersion>3.1</ejbVersion>
+          <generateClient>true</generateClient>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/test/resources/projects/project-098/ejb-two/src/main/java/eartest/Stub.java b/src/test/resources/projects/project-098/ejb-two/src/main/java/eartest/Stub.java
new file mode 100644
index 0000000..b8b0059
--- /dev/null
+++ b/src/test/resources/projects/project-098/ejb-two/src/main/java/eartest/Stub.java
@@ -0,0 +1,22 @@
+package eartest;
+
+/*
+ * 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.
+ */
+
+public class Stub {}
diff --git a/src/test/resources/projects/project-098/pom.xml b/src/test/resources/projects/project-098/pom.xml
new file mode 100644
index 0000000..56570bc
--- /dev/null
+++ b/src/test/resources/projects/project-098/pom.xml
@@ -0,0 +1,126 @@
+<?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-098-parent</artifactId>
+  <version>99.0</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>ejb-one</module>
+    <module>ejb-two</module>
+    <module>rar</module>
+    <module>war</module>
+    <module>ear</module>
+  </modules>
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+    <jboss-servlet-api_3.0_spec.version>1.0.2.Final</jboss-servlet-api_3.0_spec.version>
+    <jboss-ejb-api_3.1_spec.version>1.0.2.Final</jboss-ejb-api_3.1_spec.version>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.jboss.spec.javax.servlet</groupId>
+        <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+        <version>${jboss-servlet-api_3.0_spec.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.spec.javax.ejb</groupId>
+        <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+        <version>${jboss-ejb-api_3.1_spec.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>jar-sample-one</artifactId>
+        <version>1.0</version>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>jar-sample-two</artifactId>
+        <version>1.0</version>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>jar-sample-three-with-deps</artifactId>
+        <version>1.0</version>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>ejb-sample-three</artifactId>
+        <version>1.0</version>
+        <type>ejb</type>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>ejb-sample-four</artifactId>
+        <version>1.0</version>
+        <type>ejb</type>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>ejb-sample-four</artifactId>
+        <version>1.0</version>
+        <type>ejb-client</type>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>rar-sample-one</artifactId>
+        <version>1.0</version>
+        <type>rar</type>
+      </dependency>
+      <dependency>
+        <groupId>eartest</groupId>
+        <artifactId>war-sample-three</artifactId>
+        <version>1.0</version>
+        <type>war</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>@mavenCompilerPluginVersion@</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-ejb-plugin</artifactId>
+          <version>@mavenEjbPluginVersion@</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-rar-plugin</artifactId>
+          <version>@mavenRarPluginVersion@</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>@mavenWarPluginVersion@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/src/test/resources/projects/project-098/rar/pom.xml b/src/test/resources/projects/project-098/rar/pom.xml
new file mode 100644
index 0000000..8757ce9
--- /dev/null
+++ b/src/test/resources/projects/project-098/rar/pom.xml
@@ -0,0 +1,59 @@
+<?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>
+  <parent>
+    <groupId>ear</groupId>
+    <artifactId>maven-ear-plugin-test-project-098-parent</artifactId>
+    <version>99.0</version>
+  </parent>
+  <groupId>eartest</groupId>
+  <artifactId>rar-sample-one</artifactId>
+  <version>1.0</version>
+  <packaging>rar</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-three-with-deps</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-four</artifactId>
+      <type>ejb</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-rar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <addClasspath>true</addClasspath>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/test/resources/projects/project-098/rar/src/main/rar/META-INF/ra.xml b/src/test/resources/projects/project-098/rar/src/main/rar/META-INF/ra.xml
new file mode 100644
index 0000000..c84c609
--- /dev/null
+++ b/src/test/resources/projects/project-098/rar/src/main/rar/META-INF/ra.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+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.
+-->
+
+<connector>
+  <fake-content></fake-content>
+</connector>
diff --git a/src/test/resources/projects/project-098/rar/src/main/rar/SomeResource.txt b/src/test/resources/projects/project-098/rar/src/main/rar/SomeResource.txt
new file mode 100644
index 0000000..b74423f
--- /dev/null
+++ b/src/test/resources/projects/project-098/rar/src/main/rar/SomeResource.txt
@@ -0,0 +1,16 @@
+# 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.
diff --git a/src/test/resources/projects/project-098/war/pom.xml b/src/test/resources/projects/project-098/war/pom.xml
new file mode 100644
index 0000000..1112d26
--- /dev/null
+++ b/src/test/resources/projects/project-098/war/pom.xml
@@ -0,0 +1,64 @@
+<?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>
+  <parent>
+    <groupId>ear</groupId>
+    <artifactId>maven-ear-plugin-test-project-098-parent</artifactId>
+    <version>99.0</version>
+  </parent>
+  <groupId>eartest</groupId>
+  <artifactId>war-sample-three</artifactId>
+  <version>1.0</version>
+  <packaging>war</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.spec.javax.servlet</groupId>
+      <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>jar-sample-one</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-three</artifactId>
+      <type>ejb</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <addClasspath>true</addClasspath>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/test/resources/projects/project-098/war/src/main/webapp/WEB-INF/web.xml b/src/test/resources/projects/project-098/war/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..fbbf307
--- /dev/null
+++ b/src/test/resources/projects/project-098/war/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+<?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.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+         version="3.0">
+</web-app>