Author: krosenvold
Date: Mon Nov  3 20:01:39 2014
New Revision: 1636427

URL: http://svn.apache.org/r1636427
Log:
[MASSEMBLY-619] Bleed happens on dependencySets in modules too

Added:
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/assembly.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/child-client/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/child-client/pom.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/pom.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/assembly/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/assembly/client.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/invoker.properties
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/pom.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/verify.bsh
Modified:
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/multimodule-wholeReactorFromChild/child4/src/assemble/bin.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
    
maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/assembly.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/assembly.xml?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/assembly.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/assembly.xml
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,46 @@
+<?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.
+-->
+<assembly
+    
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
 http://maven.apache.org/xsd/assembly-1.1.0.xsd";>
+
+  <id>deploy-zip</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>dir1</outputDirectory>
+      <includes>
+        <include>commons-configuration:commons-configuration</include>
+      </includes>
+    </dependencySet>
+    <dependencySet>
+      <outputDirectory>dir2</outputDirectory>
+      <useTransitiveDependencies>false</useTransitiveDependencies>
+      <excludes>
+        <exclude>commons-configuration:commons-configuration</exclude>
+      </excludes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/child-client/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/child-client/pom.xml?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/child-client/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/child-client/pom.xml
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,49 @@
+<!--
+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/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>maven-assembly-test</artifactId>
+    <groupId>maven-assembly-test</groupId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+  <groupId>maven-assembly-test</groupId>
+  <artifactId>modul-client</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>commons-configuration</groupId>
+      <artifactId>commons-configuration</artifactId>
+      <version>1.10</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-archiver</artifactId>
+      <version>2.6</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-monitor</artifactId>
+      <version>2.2.0</version>
+      <type>jar</type>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+</project>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/pom.xml?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/pom.xml
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,95 @@
+<!--
+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/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>maven-assembly-test</artifactId>
+    <groupId>maven-assembly-test</groupId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+  <groupId>maven-assembly-test</groupId>
+  <artifactId>distribution</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>distribution</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>src/assembly/client.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>1.0.1</version>
+        <executions>
+          <execution>
+            <id>enforce-dont-exist</id>
+            <phase>package</phase>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireFilesDontExist>
+                  <message>Libary maven-default-skin-1.0.jar non client 
dependency!</message>
+                  <files>
+                    <file>
+                      
${project.build.directory}/distribution-${project.version}-all/client/lib/maven-default-skin-1.0.jar
+                    </file>
+                    <file>
+                      
${project.build.directory}/distribution-${project.version}-client/client/lib/maven-default-skin-1.0.jar
+                    </file>
+                  </files>
+                </requireFilesDontExist>
+                <requireFilesDontExist>
+                  <message>Libary maven-monitor-2.2.0.jar non server 
dependency!</message>
+                  <files>
+                    <file>
+                      
${project.build.directory}/distribution-${project.version}-all/server/lib/maven-monitor-2.2.0.jar
+                    </file>
+                    <file>
+                      
${project.build.directory}/distribution-${project.version}-server/server/lib/maven-monitor-2.2.0.jar
+                    </file>
+                  </files>
+                </requireFilesDontExist>
+              </rules>
+              <fail>true</fail>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <name>Test Distribution</name>
+  <description>Distributionmodul</description>
+</project>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/assembly/client.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/assembly/client.xml?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/assembly/client.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/descriptor/src/assembly/client.xml
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,58 @@
+<?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.
+-->
+<assembly
+    
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
 http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
+  <id>client</id>
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <moduleSets>
+    <moduleSet>
+      <useAllReactorProjects>true</useAllReactorProjects>
+      <includes>
+        <include>maven-assembly-test:*-client</include>
+      </includes>
+      <binaries>
+        <unpack>false</unpack>
+        <!-- includeDependencies>true</includeDependencies -->
+        <!-- outputFileNameMapping>testdep</outputFileNameMapping -->
+        <dependencySets>
+          <dependencySet>
+            <outputDirectory>dir1</outputDirectory>
+            <includes>
+              <include>commons-configuration:commons-configuration</include>
+            </includes>
+          </dependencySet>
+          <dependencySet>
+            <outputDirectory>dir2</outputDirectory>
+            <useTransitiveDependencies>false</useTransitiveDependencies>
+            <excludes>
+              <exclude>commons-configuration:commons-configuration</exclude>
+            </excludes>
+          </dependencySet>
+        </dependencySets>
+      </binaries>
+    </moduleSet>
+  </moduleSets>
+</assembly>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/invoker.properties?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/invoker.properties
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/invoker.properties
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals=install

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/pom.xml?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/pom.xml
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,45 @@
+<!--
+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/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>maven-assembly-test</groupId>
+  <artifactId>maven-assembly-test</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <description>Mulitproject for testing assembly</description>
+  <build>
+    <defaultGoal>clean package</defaultGoal>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-assembly-plugin</artifactId>
+          <version>${testVersion}</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+    </plugins>
+
+  </build>
+  <modules>
+    <module>child-client</module>
+    <module>descriptor</module>
+  </modules>
+</project>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/verify.bsh
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/verify.bsh?rev=1636427&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/verify.bsh
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/massembly-619/verify.bsh
 Mon Nov  3 20:01:39 2014
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+import java.io.*;
+import java.util.zip.*;
+
+File f = new File( basedir, 
"descriptor/target/distribution-0.0.1-SNAPSHOT-client/dir2/classworlds-1.1.jar" 
);
+
+return !f.exists();
+
+

Modified: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/multimodule-wholeReactorFromChild/child4/src/assemble/bin.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/multimodule-wholeReactorFromChild/child4/src/assemble/bin.xml?rev=1636427&r1=1636426&r2=1636427&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/multimodule-wholeReactorFromChild/child4/src/assemble/bin.xml
 (original)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/multimodule/multimodule-wholeReactorFromChild/child4/src/assemble/bin.xml
 Mon Nov  3 20:01:39 2014
@@ -39,7 +39,7 @@ under the License.
       <binaries>
         
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
         <outputDirectory>lib</outputDirectory>
-        <includeDependencies>true</includeDependencies>
+        <includeDependencies>false</includeDependencies>
         <unpack>false</unpack>
       </binaries>
     </moduleSet>

Modified: 
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java?rev=1636427&r1=1636426&r2=1636427&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
 (original)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
 Mon Nov  3 20:01:39 2014
@@ -105,8 +105,8 @@ public class DefaultDependencyResolver
             final ResolutionManagementInfo info = new 
ResolutionManagementInfo( currentProject );
             updateRepositoryResolutionRequirements( assembly, info );
             final AssemblyId assemblyId = AssemblyId.createAssemblyId( 
assembly );
-            updateDependencySetResolutionRequirements( 
assembly.getDependencySets(), info, assemblyId, currentProject );
-            updateModuleSetResolutionRequirements( assemblyId, moduleSet, 
info, configSource );
+            updateDependencySetResolutionRequirements( dependencySet, info, 
assemblyId, currentProject );
+            updateModuleSetResolutionRequirements( assemblyId, moduleSet, 
dependencySet, info, configSource );
 
             Set<Artifact> artifacts;
             if ( info.isResolutionRequired() )
@@ -284,23 +284,8 @@ public class DefaultDependencyResolver
         }
     }
 
-    void updateModuleSetResolutionRequirements( final Assembly assembly, final 
ResolutionManagementInfo requirements,
-                                                final 
AssemblerConfigurationSource configSource )
-        throws DependencyResolutionException
-    {
-        final List<ModuleSet> moduleSets = assembly.getModuleSets();
-
-        if ( moduleSets != null && !moduleSets.isEmpty() )
-        {
-            for ( final ModuleSet set : moduleSets )
-            {
-                updateModuleSetResolutionRequirements( 
AssemblyId.createAssemblyId( assembly.getId() ), set,
-                                                       requirements, 
configSource );
-            }
-        }
-    }
 
-    void updateModuleSetResolutionRequirements( AssemblyId assemblyId, 
ModuleSet set,
+    void updateModuleSetResolutionRequirements( AssemblyId assemblyId, 
ModuleSet set, DependencySet dependencySet,
                                                 final ResolutionManagementInfo 
requirements,
                                                 final 
AssemblerConfigurationSource configSource )
         throws DependencyResolutionException
@@ -339,63 +324,13 @@ public class DefaultDependencyResolver
 
             if ( binaries.isIncludeDependencies() )
             {
-                updateDependencySetResolutionRequirements( 
ModuleSetAssemblyPhase.getDependencySets( binaries ),
+                updateDependencySetResolutionRequirements( dependencySet,
                                                            requirements, 
assemblyId,
                                                            projects.toArray( 
new MavenProject[projects.size()] ) );
             }
         }
     }
 
-    @SuppressWarnings( "unchecked" )
-    void updateDependencySetResolutionRequirements( final List<DependencySet> 
depSets,
-                                                    final 
ResolutionManagementInfo requirements, AssemblyId assemblyId,
-                                                    final MavenProject... 
projects )
-        throws DependencyResolutionException
-    {
-        if ( depSets != null && !depSets.isEmpty() )
-        {
-            requirements.setResolutionRequired( true );
-
-            for ( final DependencySet set : depSets )
-            {
-                // Surely this must be a bug, if there's multiple depSets with 
different isUseTransitiveDependencies
-                // Yes; this is MASSEMBLY-619, possibly others. Methods using 
this version should probably be axed
-                // MASSEMBLY-619 is now delegated to different overload.
-                // This probably means there is a parallel bleed between 
dependencies for module sets.
-                requirements.setResolvedTransitively( 
set.isUseTransitiveDependencies() );
-
-                enableScope( set.getScope(), requirements );
-            }
-
-            for ( final MavenProject project : projects )
-            {
-                if ( project == null )
-                {
-                    continue;
-                }
-
-                Set<Artifact> dependencyArtifacts = 
project.getDependencyArtifacts();
-                if ( dependencyArtifacts == null )
-                {
-                    try
-                    {
-                        dependencyArtifacts = project.createArtifacts( 
factory, null, requirements.getScopeFilter() );
-                        project.setDependencyArtifacts( dependencyArtifacts );
-                    }
-                    catch ( final InvalidDependencyVersionException e )
-                    {
-                        throw new DependencyResolutionException(
-                            "Failed to create dependency artifacts for 
resolution. Assembly: " + assemblyId, e );
-                    }
-                }
-
-                requirements.addArtifacts( dependencyArtifacts );
-                getLogger().debug( "Dependencies for project: " + 
project.getId() + " are:\n" + StringUtils.join(
-                    dependencyArtifacts.iterator(), "\n" ) );
-            }
-        }
-    }
-
 
     @SuppressWarnings( "unchecked" )
     void updateDependencySetResolutionRequirements( final DependencySet set,

Modified: 
maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java?rev=1636427&r1=1636426&r2=1636427&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java
 (original)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java
 Mon Nov  3 20:01:39 2014
@@ -101,7 +101,7 @@ public class DefaultDependencyResolverTe
 
         final Assembly assembly = new Assembly();
         new DefaultDependencyResolver( resolver, metadataSource, factory, 
logger ).updateDependencySetResolutionRequirements(
-            depSets,
+            ds1,
                 info, AssemblyId.createAssemblyId( assembly),
                 project);
 
@@ -163,34 +163,34 @@ public class DefaultDependencyResolverTe
 
         final List<ModuleSet> moduleSets = new ArrayList<ModuleSet>();
 
+        final ModuleSet ms1 = new ModuleSet();
+        final DependencySet ds1 = new DependencySet();
         {
-            final ModuleSet ms = new ModuleSet();
-            ms.addInclude( "*module1*" );
-            ms.setIncludeSubModules( false );
+            ms1.addInclude( "*module1*" );
+            ms1.setIncludeSubModules( false );
 
             final ModuleBinaries mb = new ModuleBinaries();
 
-            final DependencySet ds = new DependencySet();
-            ds.setScope( Artifact.SCOPE_COMPILE );
+            ds1.setScope( Artifact.SCOPE_COMPILE );
 
-            mb.addDependencySet( ds );
-            ms.setBinaries( mb );
-            moduleSets.add( ms );
+            mb.addDependencySet( ds1 );
+            ms1.setBinaries( mb );
+            moduleSets.add( ms1 );
         }
 
+        final ModuleSet ms2 = new ModuleSet();
+        final DependencySet ds2 = new DependencySet();
         {
-            final ModuleSet ms = new ModuleSet();
-            ms.addInclude( "main-group:*" );
-            ms.setIncludeSubModules( true );
+            ms2.addInclude( "main-group:*" );
+            ms2.setIncludeSubModules( true );
 
             final ModuleBinaries mb = new ModuleBinaries();
 
-            final DependencySet ds = new DependencySet();
-            ds.setScope( Artifact.SCOPE_TEST );
+            ds2.setScope( Artifact.SCOPE_TEST );
 
-            mb.addDependencySet( ds );
-            ms.setBinaries( mb );
-            moduleSets.add( ms );
+            mb.addDependencySet( ds2 );
+            ms2.setBinaries( mb );
+            moduleSets.add( ms2 );
         }
 
         mm.replayAll();
@@ -202,7 +202,8 @@ public class DefaultDependencyResolverTe
         final Assembly assembly = new Assembly();
         assembly.setModuleSets( moduleSets );
 
-        resolver.updateModuleSetResolutionRequirements(assembly, info, cs);
+        
resolver.updateModuleSetResolutionRequirements(AssemblyId.createAssemblyId( 
assembly), ms1, ds1, info, cs);
+        
resolver.updateModuleSetResolutionRequirements(AssemblyId.createAssemblyId( 
assembly ), ms2, ds2, info, cs);
 
         assertTrue( info.isResolutionRequired() );
 


Reply via email to