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/10/13 13:43:09 UTC
[maven-ear-plugin] branch master updated: [MEAR-267] - Fixed
detection if JAR module is included into classpath of particular EAR module
manifest (#19)
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 74d28d8 [MEAR-267] - Fixed detection if JAR module is included into classpath of particular EAR module manifest (#19)
74d28d8 is described below
commit 74d28d8948f8c1ff6f9e805c5510b46b5ad5c0b3
Author: Marat Abrarov <ab...@gmail.com>
AuthorDate: Tue Oct 13 16:34:56 2020 +0300
[MEAR-267] - Fixed detection if JAR module is included into classpath of particular EAR module manifest (#19)
* [MEAR-267] - Fixed detection if EAR JAR module is included into classpath of particular EAR module manifest
* [MEAR-267] - Fixed detection of need of modification of Class-Path entry of EAR module manifest
* [MEAR-267] - Performance optimization for the case when EAR module manifest has no Class-Path entry
* [MEAR-267] - Integration tests
* [MEAR-267] - The same rules applied to modification of Class-Path manifest entry as used for removal of JAR modules from EAR modules
* [MEAR-267] - Fixed formatting of JavaDoc in tests
* [MEAR-267] - Test for the case when unpacking of EJB JARs is turned on
* [MEAR-267] - Renamed test method parameters and rephrased / fixed formatting of JavaDoc, inlined simple single-line code.
* [MEAR-267] - Minor code style fix.
* [MEAR-267] - JavaDoc simplified.
* [MEAR-267] - Test for "dirty" build.
* [MEAR-267] - Fixed modification of Class-Path entry of manifest of EAR modules when doing "dirty" build, i.e. when element with desired path already exists in target manifest Class-Path entry
* [MEAR-267] - Support of JDK 11+ in integration tests
---
pom.xml | 6 +-
.../java/org/apache/maven/plugins/ear/EarMojo.java | 48 +++++--
.../maven/plugins/ear/it/AbstractEarPluginIT.java | 153 +++++++++++++++++----
.../org/apache/maven/plugins/ear/it/EarMojoIT.java | 91 ++++++++++--
.../ear/expected-META-INF/application.xml | 32 +++++
.../resources/projects/project-089/ear/pom.xml | 67 +++++++++
.../resources/projects/project-089/ejb/pom.xml | 55 ++++++++
.../ejb/src/main/java/eartest/Stub.java | 22 +++
src/test/resources/projects/project-089/pom.xml | 96 +++++++++++++
.../resources/projects/project-089/war/pom.xml | 54 ++++++++
.../war/src/main/webapp/WEB-INF/web.xml | 24 ++++
.../ear/expected-META-INF/application.xml | 32 +++++
.../resources/projects/project-090/ear/pom.xml | 68 +++++++++
.../resources/projects/project-090/ejb/pom.xml | 55 ++++++++
.../ejb/src/main/java/eartest/Stub.java | 22 +++
src/test/resources/projects/project-090/pom.xml | 96 +++++++++++++
.../resources/projects/project-090/war/pom.xml | 54 ++++++++
.../war/src/main/webapp/WEB-INF/web.xml | 24 ++++
.../ear/expected-META-INF/application.xml | 31 +++++
.../resources/projects/project-091/ear/pom.xml | 56 ++++++++
.../resources/projects/project-091/ejb/pom.xml | 55 ++++++++
.../ejb/src/main/java/eartest/Stub.java | 22 +++
src/test/resources/projects/project-091/pom.xml | 84 +++++++++++
.../resources/projects/project-091/war/pom.xml | 54 ++++++++
.../war/src/main/webapp/WEB-INF/web.xml | 24 ++++
25 files changed, 1276 insertions(+), 49 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0f35d61..ac06435 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,6 +87,8 @@
<surefire.version>2.22.2</surefire.version>
<project.build.outputTimestamp>2020-09-26T20:10:30Z</project.build.outputTimestamp>
<mavenWarPluginVersion>2.1.1</mavenWarPluginVersion>
+ <mavenCompilerPluginVersion>2.5.1</mavenCompilerPluginVersion>
+ <mavenEjbPluginVersion>2.3</mavenEjbPluginVersion>
<invoker.skip>false</invoker.skip>
<invoker.install.skip>${invoker.skip}</invoker.install.skip>
<invoker.it.skip>${invoker.skip}</invoker.it.skip>
@@ -282,8 +284,8 @@
</goals>
<extraArtifacts>
<extraArtifact>org.apache.maven.plugins:maven-war-plugin:${mavenWarPluginVersion}:jar</extraArtifact>
- <extraArtifact>org.apache.maven.plugins:maven-compiler-plugin:2.5.1:jar</extraArtifact>
- <extraArtifact>org.apache.maven.plugins:maven-ejb-plugin:2.3:jar</extraArtifact>
+ <extraArtifact>org.apache.maven.plugins:maven-compiler-plugin:${mavenCompilerPluginVersion}:jar</extraArtifact>
+ <extraArtifact>org.apache.maven.plugins:maven-ejb-plugin:${mavenEjbPluginVersion}:jar</extraArtifact>
</extraArtifacts>
<skipInstallation>${invoker.install.skip}</skipInstallation>
<skipInvocation>${invoker.it.skip}</skipInvocation>
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 3e4ef05..3b7cd91 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 @@ public class EarMojo
}
unpack( sourceFile, destinationFile, outdatedResources );
- if ( skinnyWars && module.changeManifestClasspath() )
+ if ( module.changeManifestClasspath() && ( skinnyWars || module.getLibDir() == null ) )
{
changeManifestClasspath( module, destinationFile, javaEEVersion );
}
@@ -461,7 +461,7 @@ public class EarMojo
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 @@ public class EarMojo
// 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 @@ public class EarMojo
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 @@ public class EarMojo
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 @@ public class EarMojo
}
}
}
+
+ /**
+ * 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<String> 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 445df00..0a4fa2e 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 @@ package org.apache.maven.plugins.ear.it;
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.it.util.ResourceExtractor;
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 @@ public abstract class AbstractEarPluginIT
}
/**
- * 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 @@ public abstract class AbstractEarPluginIT
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 @@ public abstract class AbstractEarPluginIT
*
* @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 @@ public abstract class AbstractEarPluginIT
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 abstract class AbstractEarPluginIT
}
} );
}
+
+ /**
+ * 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 ad0e0c1..91ca4be 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 class EarMojoIT
{
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 class EarMojoIT
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
+ * <ul>
+ * <li>skinnyWars option is turned on</li>
+ * <li>skipClassPathModification option is turned off</li>
+ * </ul>
+ */
+ 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
+ * <ul>
+ * <li>skinnyWars option is turned on</li>
+ * <li>skipClassPathModification option is turned on</li>
+ * </ul>
+ */
+ 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
+ * <ul>
+ * <li>skinnyWars option is turned off</li>
+ * <li>skipClassPathModification option is turned off</li>
+ * <li>unpacking of EJB JARs is turned on</li>
+ * </ul>
+ */
+ 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 0000000..4e83286
--- /dev/null
+++ b/src/test/resources/projects/project-089/ear/expected-META-INF/application.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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-089</display-name>
+ <module>
+ <web>
+ <web-uri>eartest-war-sample-three-1.0.war</web-uri>
+ <context-root>/war-sample-three</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>eartest-ejb-sample-three-1.0.jar</ejb>
+ </module>
+ <library-directory>lib</library-directory>
+</application>
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 0000000..7bdd244
--- /dev/null
+++ b/src/test/resources/projects/project-089/ear/pom.xml
@@ -0,0 +1,67 @@
+<?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-089-parent</artifactId>
+ <version>99.0</version>
+ </parent>
+ <artifactId>maven-ear-plugin-test-project-089</artifactId>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-three</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-three</artifactId>
+ <type>pom</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>
+ <skinnyWars>true</skinnyWars>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
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 0000000..328f5d2
--- /dev/null
+++ b/src/test/resources/projects/project-089/ejb/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-089-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>eartest</groupId>
+ <artifactId>jar-sample-three-with-deps</artifactId>
+ </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-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 0000000..b8b0059
--- /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 0000000..968ece7
--- /dev/null
+++ b/src/test/resources/projects/project-089/pom.xml
@@ -0,0 +1,96 @@
+<?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-089-parent</artifactId>
+ <version>99.0</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>war</module>
+ <module>ejb</module>
+ <module>ear</module>
+ </modules>
+ <properties>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <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>war-sample-three</artifactId>
+ <version>1.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <version>1.0</version>
+ <type>pom</type>
+ </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-three</artifactId>
+ <version>1.0</version>
+ <type>pom</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-war-plugin</artifactId>
+ <version>@mavenWarPluginVersion@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>@mavenEjbPluginVersion@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
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 0000000..860fcf4
--- /dev/null
+++ b/src/test/resources/projects/project-089/war/pom.xml
@@ -0,0 +1,54 @@
+<?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-089-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>eartest</groupId>
+ <artifactId>jar-sample-two</artifactId>
+ </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-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 0000000..fbbf307
--- /dev/null
+++ b/src/test/resources/projects/project-089/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>
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 0000000..c3b3c3f
--- /dev/null
+++ b/src/test/resources/projects/project-090/ear/expected-META-INF/application.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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-090</display-name>
+ <module>
+ <web>
+ <web-uri>eartest-war-sample-three-1.0.war</web-uri>
+ <context-root>/war-sample-three</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>eartest-ejb-sample-three-1.0.jar</ejb>
+ </module>
+ <library-directory>lib</library-directory>
+</application>
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 0000000..655f1a2
--- /dev/null
+++ b/src/test/resources/projects/project-090/ear/pom.xml
@@ -0,0 +1,68 @@
+<?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-090-parent</artifactId>
+ <version>99.0</version>
+ </parent>
+ <artifactId>maven-ear-plugin-test-project-090</artifactId>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-three</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-three</artifactId>
+ <type>pom</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>
+ <skinnyWars>true</skinnyWars>
+ <skipClassPathModification>true</skipClassPathModification>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
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 0000000..772fa09
--- /dev/null
+++ b/src/test/resources/projects/project-090/ejb/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-090-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>eartest</groupId>
+ <artifactId>jar-sample-three-with-deps</artifactId>
+ </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-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 0000000..b8b0059
--- /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 0000000..6bac0f1
--- /dev/null
+++ b/src/test/resources/projects/project-090/pom.xml
@@ -0,0 +1,96 @@
+<?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-090-parent</artifactId>
+ <version>99.0</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>war</module>
+ <module>ejb</module>
+ <module>ear</module>
+ </modules>
+ <properties>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <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>war-sample-three</artifactId>
+ <version>1.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <version>1.0</version>
+ <type>pom</type>
+ </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-three</artifactId>
+ <version>1.0</version>
+ <type>pom</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-war-plugin</artifactId>
+ <version>@mavenWarPluginVersion@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>@mavenEjbPluginVersion@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
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 0000000..8314bdc
--- /dev/null
+++ b/src/test/resources/projects/project-090/war/pom.xml
@@ -0,0 +1,54 @@
+<?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-090-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>eartest</groupId>
+ <artifactId>jar-sample-two</artifactId>
+ </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-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 0000000..fbbf307
--- /dev/null
+++ b/src/test/resources/projects/project-090/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>
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 0000000..5ad9ffc
--- /dev/null
+++ b/src/test/resources/projects/project-091/ear/expected-META-INF/application.xml
@@ -0,0 +1,31 @@
+<?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-091</display-name>
+ <module>
+ <web>
+ <web-uri>eartest-war-sample-three-1.0.war</web-uri>
+ <context-root>/war-sample-three</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>eartest-ejb-sample-three-1.0.jar</ejb>
+ </module>
+</application>
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 0000000..fecde97
--- /dev/null
+++ b/src/test/resources/projects/project-091/ear/pom.xml
@@ -0,0 +1,56 @@
+<?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-091-parent</artifactId>
+ <version>99.0</version>
+ </parent>
+ <artifactId>maven-ear-plugin-test-project-091</artifactId>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>war</type>
+ </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-ear-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <version>6</version>
+ <unpackTypes>ejb</unpackTypes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
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 0000000..4702813
--- /dev/null
+++ b/src/test/resources/projects/project-091/ejb/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-091-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>eartest</groupId>
+ <artifactId>jar-sample-three-with-deps</artifactId>
+ </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-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 0000000..b8b0059
--- /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 0000000..61a5fc8
--- /dev/null
+++ b/src/test/resources/projects/project-091/pom.xml
@@ -0,0 +1,84 @@
+<?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-091-parent</artifactId>
+ <version>99.0</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>war</module>
+ <module>ejb</module>
+ <module>ear</module>
+ </modules>
+ <properties>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <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>war-sample-three</artifactId>
+ <version>1.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-three</artifactId>
+ <version>1.0</version>
+ <type>ejb</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-war-plugin</artifactId>
+ <version>@mavenWarPluginVersion@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>@mavenEjbPluginVersion@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
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 0000000..3001787
--- /dev/null
+++ b/src/test/resources/projects/project-091/war/pom.xml
@@ -0,0 +1,54 @@
+<?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-091-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>eartest</groupId>
+ <artifactId>jar-sample-two</artifactId>
+ </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-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 0000000..fbbf307
--- /dev/null
+++ b/src/test/resources/projects/project-091/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>