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 aebb63494c..e2d4ddda3a 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 @@ -200,7 +200,7 @@ public class DefaultLifecycleExecutor private void processPluginConfiguration( MavenProject project, MavenSession mavenSession, Map phaseMap ) throws LifecycleExecutionException, ArtifactResolutionException { - for ( Iterator i = project.getPlugins().iterator(); i.hasNext(); ) + for ( Iterator i = project.getBuildPlugins().iterator(); i.hasNext(); ) { Plugin plugin = (Plugin) i.next(); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index cfe083270f..ad3a8b46ee 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -152,7 +152,7 @@ public class DefaultPluginManager org.apache.maven.model.Plugin pluginConfig = null; - for ( Iterator it = project.getPlugins().iterator(); it.hasNext(); ) + for ( Iterator it = project.getBuildPlugins().iterator(); it.hasNext(); ) { org.apache.maven.model.Plugin plugin = (org.apache.maven.model.Plugin) it.next(); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java index 7b4029ce70..3bfdc79479 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java @@ -28,6 +28,7 @@ import org.codehaus.plexus.util.introspection.ReflectionValueExtractor; import java.io.File; import java.util.Iterator; import java.util.Map; +import java.util.List; /** * @author Jason van Zyl @@ -84,11 +85,15 @@ public class PluginParameterExpressionEvaluator try { PluginManager pluginManager = (PluginManager) context.lookup( role ); - for ( Iterator it = context.getProject().getReports().getPlugins().iterator(); it.hasNext(); ) + List reportPlugins = context.getProject().getReportPlugins(); + if ( reportPlugins != null ) { - org.apache.maven.model.Plugin plugin = (org.apache.maven.model.Plugin) it.next(); - pluginManager.verifyPlugin( plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), - context ); + for ( Iterator it = reportPlugins.iterator(); it.hasNext(); ) + { + org.apache.maven.model.Plugin plugin = (org.apache.maven.model.Plugin) it.next(); + pluginManager.verifyPlugin( plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), + context ); + } } } catch ( ComponentLookupException cle ) diff --git a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java index a50a74bbc2..ed1bd73b79 100644 --- a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java @@ -677,7 +677,16 @@ public class MavenProject // Plugins // ---------------------------------------------------------------------- - public List getPlugins() + public List getReportPlugins() + { + if ( model.getReports() == null ) + { + return null; + } + return model.getReports().getPlugins(); + + } + public List getBuildPlugins() { if ( model.getBuild() == null ) { @@ -811,9 +820,9 @@ public class MavenProject // for now I have to iterate through and see what we have. // ---------------------------------------------------------------------- - if ( getPlugins() != null ) + if ( getBuildPlugins() != null ) { - for ( Iterator iterator = getPlugins().iterator(); iterator.hasNext(); ) + for ( Iterator iterator = getBuildPlugins().iterator(); iterator.hasNext(); ) { Plugin plugin = (Plugin) iterator.next(); @@ -845,4 +854,5 @@ public class MavenProject { return model.getPluginRepositories(); } + } diff --git a/maven-project/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java b/maven-project/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java index 0350dbb931..d29e424cab 100644 --- a/maven-project/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java @@ -49,7 +49,7 @@ public class CanonicalProjectBuilderTest // Plugins // ---------------------------------------------------------------------- - List plugins = project.getPlugins(); + List plugins = project.getBuildPlugins(); // Plugin0 [plexus]