[MASSEMBLY-727] Implied dependencysets have incorrect outputfilemapping
Updated IT for massambly-395 which originally demonstrated this problem
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1636535 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 35babd3..7580240 100644
--- a/pom.xml
+++ b/pom.xml
@@ -456,6 +456,7 @@
<pomExclude>dependency-sets/depSet-enum-vs-wildcard/enum/pom.xml</pomExclude>
<pomExclude>dependency-sets/depSet-enum-vs-wildcard/wildcard/pom.xml</pomExclude>
+ <pomExclude>**/my-app*/pom.xml</pomExclude>
<pomExclude>**/child*/pom.xml</pomExclude>
<pomExclude>**/module*/pom.xml</pomExclude>
<pomExclude>**/descriptor/pom.xml</pomExclude>
diff --git a/src/it/projects/dependency-sets/massembly-395/child1/pom.xml b/src/it/projects/dependency-sets/massembly-395/child1/pom.xml
new file mode 100644
index 0000000..2a94120
--- /dev/null
+++ b/src/it/projects/dependency-sets/massembly-395/child1/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?><project>
+<!--
+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.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.mycompany.app</groupId>
+ <artifactId>my-app-module1</artifactId>
+ <name>my-app-module1</name>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <artifactId>my-app-module2</artifactId>
+ <groupId>com.mycompany.app</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/src/it/projects/dependency-sets/massembly-395/child1/src/main/java/com/mycompany/app/App.java b/src/it/projects/dependency-sets/massembly-395/child1/src/main/java/com/mycompany/app/App.java
new file mode 100644
index 0000000..357937d
--- /dev/null
+++ b/src/it/projects/dependency-sets/massembly-395/child1/src/main/java/com/mycompany/app/App.java
@@ -0,0 +1,32 @@
+package com.mycompany.app;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
diff --git a/src/it/projects/dependency-sets/massembly-395/child2/pom.xml b/src/it/projects/dependency-sets/massembly-395/child2/pom.xml
new file mode 100644
index 0000000..f066cc8
--- /dev/null
+++ b/src/it/projects/dependency-sets/massembly-395/child2/pom.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+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>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.mycompany.app</groupId>
+ <artifactId>my-app-module2</artifactId>
+ <name>my-app-module2</name>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/dependency-sets/massembly-395/child2/src/main/java/com/mycompany/app/App2.java b/src/it/projects/dependency-sets/massembly-395/child2/src/main/java/com/mycompany/app/App2.java
new file mode 100644
index 0000000..250c5e9
--- /dev/null
+++ b/src/it/projects/dependency-sets/massembly-395/child2/src/main/java/com/mycompany/app/App2.java
@@ -0,0 +1,32 @@
+package com.mycompany.app;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App2
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
diff --git a/src/it/projects/dependency-sets/massembly-395/my-app-module1/pom.xml b/src/it/projects/dependency-sets/massembly-395/my-app-module1/pom.xml
deleted file mode 100644
index 7310687..0000000
--- a/src/it/projects/dependency-sets/massembly-395/my-app-module1/pom.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?><project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.mycompany.app</groupId>
- <artifactId>my-app-module1</artifactId>
- <name>my-app-module1</name>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <artifactId>my-app-module2</artifactId>
- <groupId>com.mycompany.app</groupId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/src/it/projects/dependency-sets/massembly-395/my-app-module1/src/main/java/com/mycompany/app/App.java b/src/it/projects/dependency-sets/massembly-395/my-app-module1/src/main/java/com/mycompany/app/App.java
deleted file mode 100644
index 0f78a28..0000000
--- a/src/it/projects/dependency-sets/massembly-395/my-app-module1/src/main/java/com/mycompany/app/App.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.mycompany.app;
-
-/**
- * Hello world!
- *
- */
-public class App
-{
- public static void main( String[] args )
- {
- System.out.println( "Hello World!" );
- }
-}
diff --git a/src/it/projects/dependency-sets/massembly-395/my-app-module2/pom.xml b/src/it/projects/dependency-sets/massembly-395/my-app-module2/pom.xml
deleted file mode 100644
index 6cd3e72..0000000
--- a/src/it/projects/dependency-sets/massembly-395/my-app-module2/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?><project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.mycompany.app</groupId>
- <artifactId>my-app-module2</artifactId>
- <name>my-app-module2</name>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
diff --git a/src/it/projects/dependency-sets/massembly-395/my-app-module2/src/main/java/com/mycompany/app/App2.java b/src/it/projects/dependency-sets/massembly-395/my-app-module2/src/main/java/com/mycompany/app/App2.java
deleted file mode 100644
index bc1d84a..0000000
--- a/src/it/projects/dependency-sets/massembly-395/my-app-module2/src/main/java/com/mycompany/app/App2.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.mycompany.app;
-
-/**
- * Hello world!
- *
- */
-public class App2
-{
- public static void main( String[] args )
- {
- System.out.println( "Hello World!" );
- }
-}
diff --git a/src/it/projects/dependency-sets/massembly-395/pom.xml b/src/it/projects/dependency-sets/massembly-395/pom.xml
index 93f48d6..7142ade 100644
--- a/src/it/projects/dependency-sets/massembly-395/pom.xml
+++ b/src/it/projects/dependency-sets/massembly-395/pom.xml
@@ -1,4 +1,23 @@
<?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>com.mycompany.app</groupId>
@@ -13,10 +32,16 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.mycompany.app</groupId>
+ <artifactId>my-app-module2</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<modules>
- <module>my-app-module1</module>
- <module>my-app-module2</module>
+ <module>child1</module>
+ <module>child2</module>
</modules>
<build>
<plugins>
diff --git a/src/it/projects/dependency-sets/massembly-395/src/main/assembly/zip.xml b/src/it/projects/dependency-sets/massembly-395/src/main/assembly/zip.xml
index 83b7118..8087d45 100644
--- a/src/it/projects/dependency-sets/massembly-395/src/main/assembly/zip.xml
+++ b/src/it/projects/dependency-sets/massembly-395/src/main/assembly/zip.xml
@@ -1,3 +1,22 @@
+<!--
+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.
+-->
+
<assembly>
<id>bin</id>
<formats>
@@ -10,7 +29,7 @@
</includes>
<binaries>
<outputDirectory>modules</outputDirectory>
- <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+ <!-- outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping -->
<unpack>false</unpack>
<includeDependencies>true</includeDependencies>
diff --git a/src/it/projects/dependency-sets/massembly-395/verify.bsh b/src/it/projects/dependency-sets/massembly-395/verify.bsh
index 8401dcd..ff453bf 100644
--- a/src/it/projects/dependency-sets/massembly-395/verify.bsh
+++ b/src/it/projects/dependency-sets/massembly-395/verify.bsh
@@ -26,7 +26,7 @@
File f = new File( basedir, "target/my-app-1.0-SNAPSHOT-bin.zip" );
ZipFile zf = new ZipFile( f );
-ZipEntry child1InclEntry = zf.getEntry( "my-app-1.0-SNAPSHOT/modules/junit.jar" );
+ZipEntry child1InclEntry = zf.getEntry( "my-app-1.0-SNAPSHOT/modules/junit-3.8.1.jar" );
if ( child1InclEntry == null )
{
diff --git a/src/it/projects/dependency-sets/using-moduleSet-implied-depSet/verify.bsh b/src/it/projects/dependency-sets/using-moduleSet-implied-depSet/verify.bsh
index 70ef7fc..b03fecc 100644
--- a/src/it/projects/dependency-sets/using-moduleSet-implied-depSet/verify.bsh
+++ b/src/it/projects/dependency-sets/using-moduleSet-implied-depSet/verify.bsh
@@ -21,8 +21,8 @@
boolean result = true;
-result = result && new File( basedir, "target/using-moduleSet-implied-depSet-1.0-SNAPSHOT-bin/modules/jdom.jar" ).exists();
-result = result && new File( basedir, "target/using-moduleSet-implied-depSet-1.0-SNAPSHOT-bin/modules/velocity.jar" ).exists();
+result = result && new File( basedir, "target/using-moduleSet-implied-depSet-1.0-SNAPSHOT-bin/modules/jdom-1.0.jar" ).exists();
+result = result && new File( basedir, "target/using-moduleSet-implied-depSet-1.0-SNAPSHOT-bin/modules/velocity-1.4.jar" ).exists();
result = result && new File( basedir, "target/using-moduleSet-implied-depSet-1.0-SNAPSHOT-bin/modules/module-a.jar" ).exists();
result = result && new File( basedir, "target/using-moduleSet-implied-depSet-1.0-SNAPSHOT-bin/modules/module-b.jar" ).exists();
diff --git a/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java b/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
index 59d7d2d..0bf0846 100644
--- a/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
+++ b/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
@@ -311,7 +311,7 @@
final DependencySet impliedDependencySet = new DependencySet();
impliedDependencySet.setOutputDirectory( binaries.getOutputDirectory() );
- impliedDependencySet.setOutputFileNameMapping( binaries.getOutputFileNameMapping() );
+ //impliedDependencySet.setOutputFileNameMapping( binaries.getOutputFileNameMapping() );
impliedDependencySet.setFileMode( binaries.getFileMode() );
impliedDependencySet.setDirectoryMode( binaries.getDirectoryMode() );
impliedDependencySet.setExcludes( binaries.getExcludes() );
diff --git a/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java b/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
index 2dba16c..84b23a0 100644
--- a/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
+++ b/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
@@ -185,15 +185,6 @@
}
else
{
- /*
- Artifact primary = moduleArtifact != null ? moduleArtifact : artifact;
- Artifact secondary = moduleArtifact != null ? artifact : moduleArtifact;
- final String tempMapping =
- AssemblyFormatUtils.evaluateFileNameMapping( outputFileNameMapping, primary,
- configSource.getProject(), moduleProject, secondary,
- project, configSource );
-
- */
final String tempMapping =
AssemblyFormatUtils.evaluateFileNameMapping( outputFileNameMapping, artifact,
configSource.getProject(), moduleProject, moduleArtifact,