This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a commit to annotated tag maven-help-plugin-2.0.2 in repository https://gitbox.apache.org/repos/asf/maven-help-plugin.git
commit 8fa128841df109d13aecc8dd0714097dd46c8da2 Author: Kenney Westerhof <ken...@apache.org> AuthorDate: Fri Jan 19 12:05:46 2007 +0000 PR: MPH-21 When help:effective-pom is called from within a pom, only print out that pom's effective pom. Added check to only dump all poms if the ${project} is the head of the reactor list to enforce proper aggregator behaviour. TODO: maybe this needs an update: find the current project in the reactor projects, then dump that pom, and find all modules recursively and dump those, so you can dump a sub-tree of the reactor, when you run the mojo from the lifecycle. git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-help-plugin@497785 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugins/help/EffectivePomMojo.java | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java b/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java index 2e3236d..da22d31 100644 --- a/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java +++ b/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java @@ -39,6 +39,12 @@ import java.util.List; public class EffectivePomMojo extends AbstractMojo { + /** + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; /** * The projects in the current build. The effective-POM for @@ -64,13 +70,23 @@ public class EffectivePomMojo throws MojoExecutionException { StringBuffer message = new StringBuffer(); - - for ( Iterator it = projects.iterator(); it.hasNext(); ) + + if ( projects.get( 0 ).equals( project ) ) + { + // this is normal in aggregation mode. + + for ( Iterator it = projects.iterator(); it.hasNext(); ) + { + MavenProject project = (MavenProject) it.next(); + + getEffectivePom( project, message ); + + message.append( "\n\n" ); + } + } + else { - MavenProject project = (MavenProject) it.next(); - getEffectivePom( project, message ); - message.append( "\n\n" ); } -- To stop receiving notification emails like this one, please contact "commits@maven.apache.org" <commits@maven.apache.org>.