diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index 8390b297cd..cf6c4d5eb8 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -647,7 +647,7 @@ public class DefaultLifecycleExecutor return plugin; } - public Set populateDefaultConfigurationForPlugins( Set plugins, MavenProject project, ArtifactRepository localRepository ) + public void populateDefaultConfigurationForPlugins( Collection plugins, MavenProject project, ArtifactRepository localRepository ) throws LifecycleExecutionException { for( Plugin p : plugins ) @@ -661,8 +661,6 @@ public class DefaultLifecycleExecutor } } } - - return plugins; } public Xpp3Dom getDefaultPluginConfiguration( String groupId, String artifactId, String version, String goal, MavenProject project, ArtifactRepository localRepository ) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java index 175b5e429d..9628bebef1 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java @@ -19,6 +19,7 @@ package org.apache.maven.lifecycle; * under the License. */ +import java.util.Collection; import java.util.List; import java.util.Set; @@ -63,7 +64,7 @@ public interface LifecycleExecutor // Given a set of {@link org.apache.maven.Plugin} objects where the GAV is set we can lookup the plugin // descriptor and populate the default configuration. // - Set populateDefaultConfigurationForPlugins( Set plugins, MavenProject project, ArtifactRepository localRepository ) + void populateDefaultConfigurationForPlugins( Collection plugins, MavenProject project, ArtifactRepository localRepository ) throws LifecycleExecutionException; void execute( MavenSession session ) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 8508867621..ed7da166f6 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -176,9 +176,9 @@ public class DefaultMavenProjectBuilder // 3. POM values from per-execution configuration // These configuration sources are given in increasing order of dominance. - Set processedPlugins = lifecycle.populateDefaultConfigurationForPlugins( pluginsFromProject, project, configuration.getLocalRepository() ); + lifecycle.populateDefaultConfigurationForPlugins( pluginsFromProject, project, configuration.getLocalRepository() ); - for ( Plugin buildPlugin : processedPlugins ) + for ( Plugin buildPlugin : pluginsFromProject ) { Xpp3Dom dom = (Xpp3Dom) buildPlugin.getConfiguration(); Plugin x = containsPlugin( buildPlugin, project.getModel().getBuild().getPlugins() ); @@ -205,7 +205,7 @@ public class DefaultMavenProjectBuilder } } - project.getModel().getBuild().setPlugins( new ArrayList( processedPlugins ) ); + project.getModel().getBuild().setPlugins( new ArrayList( pluginsFromProject ) ); } catch ( IOException e ) { diff --git a/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java b/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java index 25bac78c2a..29ef8cf1bc 100644 --- a/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java +++ b/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java @@ -19,6 +19,7 @@ package org.apache.maven.project; * under the License. */ +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; @@ -71,11 +72,10 @@ public class EmptyLifecycleExecutor return Collections.emptySet(); } - public Set populateDefaultConfigurationForPlugins( Set plugins, MavenProject project, + public void populateDefaultConfigurationForPlugins( Collection plugins, MavenProject project, ArtifactRepository localRepository ) throws LifecycleExecutionException { - return plugins; } }