diff --git a/pom.xml b/pom.xml
index aae6f4fa..8ba855c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,6 +87,8 @@
2.22.2
2020-09-26T20:10:30Z
2.1.1
+ 2.5.1
+ 2.3
false
${invoker.skip}
${invoker.skip}
@@ -282,8 +284,8 @@
org.apache.maven.plugins:maven-war-plugin:${mavenWarPluginVersion}:jar
- org.apache.maven.plugins:maven-compiler-plugin:2.5.1:jar
- org.apache.maven.plugins:maven-ejb-plugin:2.3:jar
+ org.apache.maven.plugins:maven-compiler-plugin:${mavenCompilerPluginVersion}:jar
+ org.apache.maven.plugins:maven-ejb-plugin:${mavenEjbPluginVersion}:jar
${invoker.install.skip}
${invoker.it.skip}
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 3e4ef05d..3b7cd919 100644
--- a/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
@@ -449,7 +449,7 @@ private void copyModules( final JavaEEVersion javaEEVersion,
}
unpack( sourceFile, destinationFile, outdatedResources );
- if ( skinnyWars && module.changeManifestClasspath() )
+ if ( module.changeManifestClasspath() && ( skinnyWars || module.getLibDir() == null ) )
{
changeManifestClasspath( module, destinationFile, javaEEVersion );
}
@@ -461,7 +461,7 @@ private void copyModules( final JavaEEVersion javaEEVersion,
getLog().info( "Copying artifact [" + module + "] to [" + module.getUri() + "]" );
FileUtils.copyFile( sourceFile, destinationFile );
- if ( skinnyWars && module.changeManifestClasspath() )
+ if ( module.changeManifestClasspath() && ( skinnyWars || module.getLibDir() == null ) )
{
changeManifestClasspath( module, destinationFile, javaEEVersion );
}
@@ -808,8 +808,8 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
// 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
// will not be cleaned up.
- File artifact = new File( new File( workDirectory, module.getLibDir() ),
- module.getArtifact().getFile().getName() );
+ final File workLibDir = new File( workDirectory, module.getLibDir() );
+ File artifact = new File( workLibDir, module.getArtifact().getFile().getName() );
// MEAR-217
// If WAR contains files with timestamps, but EAR strips them away (useBaseVersion=true)
@@ -818,16 +818,15 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
if ( !artifact.exists() )
{
getLog().debug( "module does not exist with original file name." );
- artifact = new File( new File( workDirectory, module.getLibDir() ), jm.getBundleFileName() );
+ artifact = new File( workLibDir, jm.getBundleFileName() );
getLog().debug( "Artifact with mapping:" + artifact.getAbsolutePath() );
}
if ( !artifact.exists() )
{
getLog().debug( "Artifact with mapping does not exist." );
- artifact = new File( new File( workDirectory, module.getLibDir() ),
- jm.getArtifact().getFile().getName() );
- getLog().debug( "Artifact with orignal file name:" + artifact.getAbsolutePath() );
+ artifact = new File( workLibDir, jm.getArtifact().getFile().getName() );
+ getLog().debug( "Artifact with original file name:" + artifact.getAbsolutePath() );
}
if ( artifact.exists() )
@@ -847,9 +846,10 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
if ( o instanceof JarModule )
{
JarModule jm = (JarModule) o;
- if ( classPathElements.contains( jm.getBundleFileName() ) )
+ final int moduleClassPathIndex = findModuleInClassPathElements( classPathElements, jm );
+ if ( moduleClassPathIndex != -1 )
{
- classPathElements.set( classPathElements.indexOf( jm.getBundleFileName() ), jm.getUri() );
+ classPathElements.set( moduleClassPathIndex, jm.getUri() );
}
else
{
@@ -948,4 +948,32 @@ private void deleteOutdatedResources( final Collection outdatedResources
}
}
}
+
+ /**
+ * Searches for the given JAR module in the list of classpath elements. If JAR module is found among specified
+ * classpath elements then returns index of first matching element. Returns -1 otherwise.
+ *
+ * @param classPathElements classpath elements to search among
+ * @param module module to find among classpath elements defined by {@code classPathElements}
+ * @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 classPathElements, final JarModule module )
+ {
+ if ( classPathElements.isEmpty() )
+ {
+ return -1;
+ }
+ int moduleClassPathIndex = classPathElements.indexOf( module.getBundleFileName() );
+ if ( moduleClassPathIndex != -1 )
+ {
+ return moduleClassPathIndex;
+ }
+ moduleClassPathIndex = classPathElements.indexOf( module.getArtifact().getFile().getName() );
+ if ( moduleClassPathIndex != -1 )
+ {
+ return moduleClassPathIndex;
+ }
+ return classPathElements.indexOf( module.getUri() );
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java b/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
index 445df00b..0a4fa2e2 100644
--- a/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
+++ b/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
@@ -22,10 +22,15 @@
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+import java.util.jar.Manifest;
+import java.util.zip.ZipEntry;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -39,6 +44,7 @@
import org.apache.maven.plugins.ear.util.ResourceEntityResolver;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLAssert;
+import org.junit.Assert;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -126,33 +132,47 @@ protected File executeMojo( final String projectName, final Properties propertie
}
/**
- * Executes the specified projects and asserts the given artifacts. Assert the deployment descriptors are valid
+ * Executes the specified projects and asserts the given artifacts. Asserts the deployment descriptors are valid.
+ * Asserts Class-Path entry of manifest of EAR modules.
*
* @param projectName the project to test
* @param earModuleName the name of 1st level EAR module in multi-module project or null if project is single-module
* @param expectedArtifacts the list of artifacts to be found in the EAR archive
* @param artifactsDirectory whether the artifact is an exploded artifactsDirectory or not
+ * @param artifactsToValidateManifest the list of EAR archive artifacts to validate Class-Path entry of artifact
+ * manifest or {@code null} if there is no need to validate Class-Path entry
+ * @param artifactsToValidateManifestDirectory whether the artifact from {@code artifactsToValidateManifest} list is
+ * an exploded or not, can be {@code null} if
+ * {@code artifactsToValidateManifest} is {@code null}
+ * @param expectedClassPathElements the list of elements of Class-Path entry of manifest, rows should match
+ * artifacts passed in {@code artifactsToValidateManifest} parameter;
+ * can be {@code null} if {@code artifactsToValidateManifest} is {@code null}
* @param cleanBeforeExecute call clean plugin before execution
* @return the base directory of the project
*/
- protected File doTestProject( final String projectName, final String earModuleName, final String[] expectedArtifacts,
- final boolean[] artifactsDirectory, boolean cleanBeforeExecute )
+ protected File doTestProject( final String projectName, final String earModuleName,
+ final String[] expectedArtifacts, boolean[] artifactsDirectory,
+ final String[] artifactsToValidateManifest,
+ boolean[] artifactsToValidateManifestDirectory,
+ final String[][] expectedClassPathElements,
+ final boolean cleanBeforeExecute )
throws VerificationException, IOException
{
final File baseDir = executeMojo( projectName, new Properties(), true, cleanBeforeExecute );
- final File earDir = earModuleName == null ? baseDir : new File( baseDir, earModuleName );
- assertEarArchive( earDir, projectName );
- assertEarDirectory( earDir, projectName );
- assertArchiveContent( earDir, projectName, expectedArtifacts, artifactsDirectory );
-
- assertDeploymentDescriptors( earDir, projectName );
+ final File earModuleDir = getEarModuleDirectory( baseDir, earModuleName );
+ assertEarArchive( earModuleDir, projectName );
+ assertEarDirectory( earModuleDir, projectName );
+ assertArchiveContent( earModuleDir, projectName, expectedArtifacts, artifactsDirectory );
+ assertDeploymentDescriptors( earModuleDir, projectName );
+ assertClassPathElements( earModuleDir, projectName, artifactsToValidateManifest,
+ artifactsToValidateManifestDirectory, expectedClassPathElements );
return baseDir;
}
/**
- * Executes the specified projects and asserts the given artifacts. Assert the deployment descriptors are valid
+ * Executes the specified projects and asserts the given artifacts. Assert the deployment descriptors are valid.
*
* @param projectName the project to test
* @param expectedArtifacts the list of artifacts to be found in the EAR archive
@@ -163,7 +183,7 @@ protected File doTestProject( final String projectName, final String[] expectedA
final boolean[] artifactsDirectory )
throws VerificationException, IOException
{
- return doTestProject( projectName, null, expectedArtifacts, artifactsDirectory, true );
+ return doTestProject( projectName, null, expectedArtifacts, artifactsDirectory, null, null, null, true );
}
/**
@@ -171,31 +191,14 @@ protected File doTestProject( final String projectName, final String[] expectedA
*
* @param projectName the project to test
* @param expectedArtifacts the list of artifacts to be found in the EAR archive
- * @param testDeploymentDescriptors whether we should test deployment descriptors
* @return the base directory of the project
*/
- private File doTestProject( final String projectName, final String[] expectedArtifacts,
- boolean testDeploymentDescriptors )
+ protected File doTestProject( final String projectName, final String[] expectedArtifacts )
throws VerificationException, IOException
{
return doTestProject( projectName, expectedArtifacts, new boolean[expectedArtifacts.length] );
}
- /**
- * Executes the specified projects and asserts the given artifacts as artifacts (non directory). Assert the
- * deployment descriptors are valid
- *
- * @param projectName the project to test
- * @param expectedArtifacts the list of artifacts to be found in the EAR archive
- * @return the base directory of the project
- * @throws Exception Mojo exception in case of an error.
- */
- protected File doTestProject( final String projectName, final String[] expectedArtifacts )
- throws Exception
- {
- return doTestProject( projectName, expectedArtifacts, true );
- }
-
protected void assertEarArchive( final File baseDir, final String projectName )
{
assertTrue( "EAR archive does not exist", getEarArchive( baseDir, projectName ).exists() );
@@ -206,6 +209,11 @@ protected void assertEarDirectory( final File baseDir, final String projectName
assertTrue( "EAR archive directory does not exist", getEarDirectory( baseDir, projectName ).exists() );
}
+ protected File getEarModuleDirectory( final File baseDir, final String earModuleName)
+ {
+ return earModuleName == null ? baseDir : new File( baseDir, earModuleName );
+ }
+
protected File getTargetDirectory( final File basedir )
{
return new File( basedir, "target" );
@@ -404,4 +412,91 @@ public boolean accept( File dir, String name )
}
} );
}
+
+ /**
+ * Asserts that given EAR archive artifacts have expected elements in artifact manifest Class-Path entry.
+ *
+ * @param baseDir the directory of the tested project
+ * @param projectName the name of the project
+ * @param artifacts the list of EAR archive artifacts to validate Class-Path entry of artifact manifest or
+ * {@code null} if there is no need to validate Class-Path entry
+ * @param artifactsDirectory whether the artifact from {@code artifacts} list is an exploded or not,
+ * can be {@code null} if {@code artifacts} is {@code null}
+ * @param expectedClassPathElements the list of expected elements of Class-Path entry of manifest, rows should match
+ * artifacts passed in {@code artifacts} parameter; can be {@code null}
+ * if {@code artifacts} is {@code null}
+ * @throws IOException exception in case of an failure during reading of artifact manifest.
+ */
+ protected void assertClassPathElements( final File baseDir, String projectName, String[] artifacts,
+ boolean[] artifactsDirectory, String[][] expectedClassPathElements )
+ throws IOException
+ {
+ if ( artifacts == null )
+ {
+ return;
+ }
+
+ assertNotNull( "artifactsDirectory should be provided if artifacts is provided",
+ artifactsDirectory );
+ assertTrue( "Size of artifactsDirectory should match size of artifacts parameter",
+ artifacts.length <= artifactsDirectory.length );
+ assertNotNull( "expectedClassPathElements should be provided if artifacts is provided",
+ expectedClassPathElements );
+ assertTrue( "Rows of expectedClassPathElements parameter should match items of artifacts parameter",
+ artifacts.length <= expectedClassPathElements.length );
+
+ final File earFile = getEarArchive( baseDir, projectName );
+ for ( int i = 0; i != artifacts.length; ++i )
+ {
+ final String moduleArtifact = artifacts[i];
+ Assert.assertArrayEquals( "Wrong elements of Class-Path entry of module [" + moduleArtifact + "] manifest",
+ expectedClassPathElements[i],
+ getClassPathElements( earFile, moduleArtifact, artifactsDirectory[i] ) );
+ }
+ }
+
+ /**
+ * Retrieves elements of Class-Path entry of manifest of given EAR module.
+ *
+ * @param earFile the EAR file to investigate
+ * @param artifact the name of artifact in EAR archive representing EAR module
+ * @return elements of Class-Path entry of manifest of EAR module which is represented by
+ * {@code artifact} artifact in {@code earFile} file
+ */
+ protected String[] getClassPathElements( final File earFile, final String artifact, final boolean directory )
+ throws IOException
+ {
+ final String classPath;
+ try ( JarFile earJarFile = new JarFile( earFile ) )
+ {
+ final ZipEntry moduleEntry = earJarFile.getEntry( artifact );
+ assertNotNull( "Artifact [" + artifact + "] should exist in EAR", moduleEntry );
+ if (directory)
+ {
+ final String manifestEntryName = artifact + "/META-INF/MANIFEST.MF";
+ final ZipEntry manifestEntry = earJarFile.getEntry( manifestEntryName );
+ assertNotNull( manifestEntryName + " manifest file should exist in EAR", manifestEntry );
+ try ( InputStream manifestInputStream = earJarFile.getInputStream( manifestEntry ) )
+ {
+ final Manifest manifest = new Manifest(manifestInputStream);
+ classPath = manifest.getMainAttributes().getValue( "Class-Path" );
+ }
+ }
+ else
+ {
+ try ( InputStream moduleInputStream = earJarFile.getInputStream( moduleEntry );
+ JarInputStream moduleJarInputStream = new JarInputStream( moduleInputStream ) )
+ {
+ final Manifest manifest = moduleJarInputStream.getManifest();
+ assertNotNull( "Artifact [" + artifact + "] of EAR should have manifest", manifest );
+ classPath = manifest.getMainAttributes().getValue( "Class-Path" );
+ }
+ }
+ }
+ if ( classPath == null )
+ {
+ return new String[0];
+ }
+ return classPath.split( " " );
+ }
}
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 ad0e0c1e..91ca4be2 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
@@ -187,8 +187,7 @@ public void testProject016()
{
final File baseDir = doTestProject( "project-016", new String[] { "eartest-ejb-sample-one-1.0.jar" } );
- final File targetFolder = new File( baseDir, "target" );
- final File createdEarFile = new File( targetFolder, "maven-ear-plugin-test-project-016-99.0.ear" );
+ final File createdEarFile = getEarArchive( baseDir, "project-016" );
final File sourceManifestFile = new File( baseDir, "src/main/ear/MANIFEST.MF" );
@@ -909,15 +908,91 @@ public void testProject087()
public void testProject088()
throws Exception
{
- final String[] expectedArtifacts = {
- "eartest-war-sample-two-1.0.war",
- "eartest-ejb-sample-one-1.0.jar",
- "lib/eartest-jar-sample-two-1.0.jar" };
+ final String warModule = "eartest-war-sample-two-1.0.war";
+ final String ejbModule = "eartest-ejb-sample-one-1.0.jar";
+ final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
+ final String[] expectedArtifacts = { warModule, ejbModule, jarSampleTwoLibrary };
final boolean[] artifactsDirectory = { false, true, false };
+ final String[] artifactsToValidateManifest = { warModule, ejbModule };
+ final boolean[] artifactsToValidateManifestDirectory = { false, true };
+ final String[][] expectedClassPathElements = { { jarSampleTwoLibrary }, { jarSampleTwoLibrary } };
+
// "Clean" build - target directories and files do not exist
// Pass cleanBeforeExecute parameter to ensure that target location is cleaned before Mojo execution
- doTestProject( "project-088", "ear", expectedArtifacts, artifactsDirectory, true );
+ doTestProject( "project-088", "ear", expectedArtifacts, artifactsDirectory,
+ artifactsToValidateManifest, artifactsToValidateManifestDirectory, expectedClassPathElements, true );
// "Dirty" build - target directories and files exist
- doTestProject( "project-088", "ear", expectedArtifacts, artifactsDirectory, false );
+ doTestProject( "project-088", "ear", expectedArtifacts, artifactsDirectory,
+ artifactsToValidateManifest, artifactsToValidateManifestDirectory, expectedClassPathElements, false );
+ }
+
+ /**
+ * Validates modification of Class-Path entry of EAR modules manifest when
+ *
+ * - skinnyWars option is turned on
+ * - skipClassPathModification option is turned off
+ *
+ */
+ public void testProject089()
+ throws Exception
+ {
+ final String warModule = "eartest-war-sample-three-1.0.war";
+ final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
+ final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
+ final String jarSampleThreeLibrary = "lib/eartest-jar-sample-three-with-deps-1.0.jar";
+ doTestProject( "project-089", "ear",
+ new String[] { warModule, ejbModule, jarSampleTwoLibrary, jarSampleThreeLibrary },
+ new boolean[] { false, false, false, false},
+ new String[] { warModule, ejbModule },
+ new boolean[] { false, false },
+ new String[][] { { jarSampleTwoLibrary, jarSampleThreeLibrary }, { jarSampleThreeLibrary, jarSampleTwoLibrary } },
+ true );
+ }
+
+ /**
+ * Validates modification of Class-Path entry of EAR modules manifest when
+ *
+ * - skinnyWars option is turned on
+ * - skipClassPathModification option is turned on
+ *
+ */
+ public void testProject090()
+ throws Exception
+ {
+ final String warModule = "eartest-war-sample-three-1.0.war";
+ final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
+ final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
+ final String jarSampleThreeLibrary = "lib/eartest-jar-sample-three-with-deps-1.0.jar";
+ doTestProject( "project-090", "ear",
+ new String[] { warModule, ejbModule, jarSampleTwoLibrary, jarSampleThreeLibrary },
+ new boolean[] { false, false, false, false },
+ new String[] { warModule, ejbModule },
+ new boolean[] { false, false },
+ new String[][] { { jarSampleTwoLibrary }, { jarSampleThreeLibrary, jarSampleTwoLibrary } },
+ true );
+ }
+
+ /**
+ * Validates modification of Class-Path entry of EAR modules manifest when
+ *
+ * - skinnyWars option is turned off
+ * - skipClassPathModification option is turned off
+ * - unpacking of EJB JARs is turned on
+ *
+ */
+ public void testProject091()
+ throws Exception
+ {
+ final String warModule = "eartest-war-sample-three-1.0.war";
+ final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
+ final String jarSampleTwoLibrary = "eartest-jar-sample-two-1.0.jar";
+ final String jarSampleThreeLibrary = "eartest-jar-sample-three-with-deps-1.0.jar";
+ doTestProject( "project-091", "ear",
+ new String[] { warModule, ejbModule, jarSampleTwoLibrary, jarSampleThreeLibrary },
+ new boolean[] { false, true, false, false },
+ new String[] { warModule, ejbModule },
+ new boolean[] { false, true },
+ new String[][] { { "jar-sample-two-1.0.jar" }, { jarSampleThreeLibrary, jarSampleTwoLibrary } },
+ true );
}
}
diff --git a/src/test/resources/projects/project-089/ear/expected-META-INF/application.xml b/src/test/resources/projects/project-089/ear/expected-META-INF/application.xml
new file mode 100644
index 00000000..4e832860
--- /dev/null
+++ b/src/test/resources/projects/project-089/ear/expected-META-INF/application.xml
@@ -0,0 +1,32 @@
+
+
+
+ maven-ear-plugin-test-project-089
+
+
+ eartest-war-sample-three-1.0.war
+ /war-sample-three
+
+
+
+ eartest-ejb-sample-three-1.0.jar
+
+ lib
+
diff --git a/src/test/resources/projects/project-089/ear/pom.xml b/src/test/resources/projects/project-089/ear/pom.xml
new file mode 100644
index 00000000..7bdd2448
--- /dev/null
+++ b/src/test/resources/projects/project-089/ear/pom.xml
@@ -0,0 +1,67 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-089-parent
+ 99.0
+
+ maven-ear-plugin-test-project-089
+ ear
+
+
+ eartest
+ war-sample-three
+ war
+
+
+ eartest
+ war-sample-three
+ pom
+
+
+ eartest
+ ejb-sample-three
+ ejb
+
+
+ eartest
+ ejb-sample-three
+ pom
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-ear-plugin
+ @project.version@
+
+ 6
+ lib
+ true
+
+
+
+
+
diff --git a/src/test/resources/projects/project-089/ejb/pom.xml b/src/test/resources/projects/project-089/ejb/pom.xml
new file mode 100644
index 00000000..328f5d2d
--- /dev/null
+++ b/src/test/resources/projects/project-089/ejb/pom.xml
@@ -0,0 +1,55 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-089-parent
+ 99.0
+
+ eartest
+ ejb-sample-three
+ 1.0
+ ejb
+
+
+ eartest
+ jar-sample-three-with-deps
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-ejb-plugin
+
+ 3.1
+
+
+ true
+
+
+
+
+
+
+
diff --git a/src/test/resources/projects/project-089/ejb/src/main/java/eartest/Stub.java b/src/test/resources/projects/project-089/ejb/src/main/java/eartest/Stub.java
new file mode 100644
index 00000000..b8b0059c
--- /dev/null
+++ b/src/test/resources/projects/project-089/ejb/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-089/pom.xml b/src/test/resources/projects/project-089/pom.xml
new file mode 100644
index 00000000..968ece76
--- /dev/null
+++ b/src/test/resources/projects/project-089/pom.xml
@@ -0,0 +1,96 @@
+
+
+
+
+ 4.0.0
+ ear
+ maven-ear-plugin-test-project-089-parent
+ 99.0
+ pom
+
+ war
+ ejb
+ ear
+
+
+ 1.7
+ 1.7
+
+
+
+
+ eartest
+ jar-sample-two
+ 1.0
+
+
+ eartest
+ jar-sample-three-with-deps
+ 1.0
+
+
+ eartest
+ war-sample-three
+ 1.0
+ war
+
+
+ eartest
+ war-sample-three
+ 1.0
+ pom
+
+
+ eartest
+ ejb-sample-three
+ 1.0
+ ejb
+
+
+ eartest
+ ejb-sample-three
+ 1.0
+ pom
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ @mavenWarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-ejb-plugin
+ @mavenEjbPluginVersion@
+
+
+
+
+
diff --git a/src/test/resources/projects/project-089/war/pom.xml b/src/test/resources/projects/project-089/war/pom.xml
new file mode 100644
index 00000000..860fcf4c
--- /dev/null
+++ b/src/test/resources/projects/project-089/war/pom.xml
@@ -0,0 +1,54 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-089-parent
+ 99.0
+
+ eartest
+ war-sample-three
+ 1.0
+ war
+
+
+ eartest
+ jar-sample-two
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+
+ true
+
+
+
+
+
+
+
diff --git a/src/test/resources/projects/project-089/war/src/main/webapp/WEB-INF/web.xml b/src/test/resources/projects/project-089/war/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 00000000..fbbf3070
--- /dev/null
+++ b/src/test/resources/projects/project-089/war/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+
+
+
+
diff --git a/src/test/resources/projects/project-090/ear/expected-META-INF/application.xml b/src/test/resources/projects/project-090/ear/expected-META-INF/application.xml
new file mode 100644
index 00000000..c3b3c3f9
--- /dev/null
+++ b/src/test/resources/projects/project-090/ear/expected-META-INF/application.xml
@@ -0,0 +1,32 @@
+
+
+
+ maven-ear-plugin-test-project-090
+
+
+ eartest-war-sample-three-1.0.war
+ /war-sample-three
+
+
+
+ eartest-ejb-sample-three-1.0.jar
+
+ lib
+
diff --git a/src/test/resources/projects/project-090/ear/pom.xml b/src/test/resources/projects/project-090/ear/pom.xml
new file mode 100644
index 00000000..655f1a2e
--- /dev/null
+++ b/src/test/resources/projects/project-090/ear/pom.xml
@@ -0,0 +1,68 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-090-parent
+ 99.0
+
+ maven-ear-plugin-test-project-090
+ ear
+
+
+ eartest
+ war-sample-three
+ war
+
+
+ eartest
+ war-sample-three
+ pom
+
+
+ eartest
+ ejb-sample-three
+ ejb
+
+
+ eartest
+ ejb-sample-three
+ pom
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-ear-plugin
+ @project.version@
+
+ 6
+ lib
+ true
+ true
+
+
+
+
+
diff --git a/src/test/resources/projects/project-090/ejb/pom.xml b/src/test/resources/projects/project-090/ejb/pom.xml
new file mode 100644
index 00000000..772fa09c
--- /dev/null
+++ b/src/test/resources/projects/project-090/ejb/pom.xml
@@ -0,0 +1,55 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-090-parent
+ 99.0
+
+ eartest
+ ejb-sample-three
+ 1.0
+ ejb
+
+
+ eartest
+ jar-sample-three-with-deps
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-ejb-plugin
+
+ 3.1
+
+
+ true
+
+
+
+
+
+
+
diff --git a/src/test/resources/projects/project-090/ejb/src/main/java/eartest/Stub.java b/src/test/resources/projects/project-090/ejb/src/main/java/eartest/Stub.java
new file mode 100644
index 00000000..b8b0059c
--- /dev/null
+++ b/src/test/resources/projects/project-090/ejb/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-090/pom.xml b/src/test/resources/projects/project-090/pom.xml
new file mode 100644
index 00000000..6bac0f13
--- /dev/null
+++ b/src/test/resources/projects/project-090/pom.xml
@@ -0,0 +1,96 @@
+
+
+
+
+ 4.0.0
+ ear
+ maven-ear-plugin-test-project-090-parent
+ 99.0
+ pom
+
+ war
+ ejb
+ ear
+
+
+ 1.7
+ 1.7
+
+
+
+
+ eartest
+ jar-sample-two
+ 1.0
+
+
+ eartest
+ jar-sample-three-with-deps
+ 1.0
+
+
+ eartest
+ war-sample-three
+ 1.0
+ war
+
+
+ eartest
+ war-sample-three
+ 1.0
+ pom
+
+
+ eartest
+ ejb-sample-three
+ 1.0
+ ejb
+
+
+ eartest
+ ejb-sample-three
+ 1.0
+ pom
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ @mavenWarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-ejb-plugin
+ @mavenEjbPluginVersion@
+
+
+
+
+
diff --git a/src/test/resources/projects/project-090/war/pom.xml b/src/test/resources/projects/project-090/war/pom.xml
new file mode 100644
index 00000000..8314bdc1
--- /dev/null
+++ b/src/test/resources/projects/project-090/war/pom.xml
@@ -0,0 +1,54 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-090-parent
+ 99.0
+
+ eartest
+ war-sample-three
+ 1.0
+ war
+
+
+ eartest
+ jar-sample-two
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+
+ true
+
+
+
+
+
+
+
diff --git a/src/test/resources/projects/project-090/war/src/main/webapp/WEB-INF/web.xml b/src/test/resources/projects/project-090/war/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 00000000..fbbf3070
--- /dev/null
+++ b/src/test/resources/projects/project-090/war/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+
+
+
+
diff --git a/src/test/resources/projects/project-091/ear/expected-META-INF/application.xml b/src/test/resources/projects/project-091/ear/expected-META-INF/application.xml
new file mode 100644
index 00000000..5ad9ffc0
--- /dev/null
+++ b/src/test/resources/projects/project-091/ear/expected-META-INF/application.xml
@@ -0,0 +1,31 @@
+
+
+
+ maven-ear-plugin-test-project-091
+
+
+ eartest-war-sample-three-1.0.war
+ /war-sample-three
+
+
+
+ eartest-ejb-sample-three-1.0.jar
+
+
diff --git a/src/test/resources/projects/project-091/ear/pom.xml b/src/test/resources/projects/project-091/ear/pom.xml
new file mode 100644
index 00000000..fecde971
--- /dev/null
+++ b/src/test/resources/projects/project-091/ear/pom.xml
@@ -0,0 +1,56 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-091-parent
+ 99.0
+
+ maven-ear-plugin-test-project-091
+ ear
+
+
+ eartest
+ war-sample-three
+ war
+
+
+ eartest
+ ejb-sample-three
+ ejb
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-ear-plugin
+ @project.version@
+
+ 6
+ ejb
+
+
+
+
+
diff --git a/src/test/resources/projects/project-091/ejb/pom.xml b/src/test/resources/projects/project-091/ejb/pom.xml
new file mode 100644
index 00000000..47028134
--- /dev/null
+++ b/src/test/resources/projects/project-091/ejb/pom.xml
@@ -0,0 +1,55 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-091-parent
+ 99.0
+
+ eartest
+ ejb-sample-three
+ 1.0
+ ejb
+
+
+ eartest
+ jar-sample-three-with-deps
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-ejb-plugin
+
+ 3.1
+
+
+ true
+
+
+
+
+
+
+
diff --git a/src/test/resources/projects/project-091/ejb/src/main/java/eartest/Stub.java b/src/test/resources/projects/project-091/ejb/src/main/java/eartest/Stub.java
new file mode 100644
index 00000000..b8b0059c
--- /dev/null
+++ b/src/test/resources/projects/project-091/ejb/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-091/pom.xml b/src/test/resources/projects/project-091/pom.xml
new file mode 100644
index 00000000..61a5fc8f
--- /dev/null
+++ b/src/test/resources/projects/project-091/pom.xml
@@ -0,0 +1,84 @@
+
+
+
+
+ 4.0.0
+ ear
+ maven-ear-plugin-test-project-091-parent
+ 99.0
+ pom
+
+ war
+ ejb
+ ear
+
+
+ 1.7
+ 1.7
+
+
+
+
+ eartest
+ jar-sample-two
+ 1.0
+
+
+ eartest
+ jar-sample-three-with-deps
+ 1.0
+
+
+ eartest
+ war-sample-three
+ 1.0
+ war
+
+
+ eartest
+ ejb-sample-three
+ 1.0
+ ejb
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ @mavenWarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-ejb-plugin
+ @mavenEjbPluginVersion@
+
+
+
+
+
diff --git a/src/test/resources/projects/project-091/war/pom.xml b/src/test/resources/projects/project-091/war/pom.xml
new file mode 100644
index 00000000..30017872
--- /dev/null
+++ b/src/test/resources/projects/project-091/war/pom.xml
@@ -0,0 +1,54 @@
+
+
+
+
+ 4.0.0
+
+ ear
+ maven-ear-plugin-test-project-091-parent
+ 99.0
+
+ eartest
+ war-sample-three
+ 1.0
+ war
+
+
+ eartest
+ jar-sample-two
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+
+ true
+
+
+
+
+
+
+
diff --git a/src/test/resources/projects/project-091/war/src/main/webapp/WEB-INF/web.xml b/src/test/resources/projects/project-091/war/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 00000000..fbbf3070
--- /dev/null
+++ b/src/test/resources/projects/project-091/war/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+
+
+
+