From 9811be2c3e521ddc12f11952fdab75c786eab89f Mon Sep 17 00:00:00 2001
From: Benjamin Bentmann <bentmann@apache.org>
Date: Sun, 23 Nov 2008 16:09:58 +0000
Subject: [PATCH] [MNG-3787] Add plugin version to default reports

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@720001 13f79535-47bb-0310-9956-ffa450edef68
---
 .../lifecycle/binding/DefaultLifecycleBindingManager.java  | 7 +++++--
 .../src/main/resources/META-INF/plexus/components.xml      | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/binding/DefaultLifecycleBindingManager.java b/maven-core/src/main/java/org/apache/maven/lifecycle/binding/DefaultLifecycleBindingManager.java
index 463736a1dd..aeadc268a3 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/binding/DefaultLifecycleBindingManager.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/binding/DefaultLifecycleBindingManager.java
@@ -484,14 +484,16 @@ public class DefaultLifecycleBindingManager
                 String report = (String) i.next();
 
                 StringTokenizer tok = new StringTokenizer( report, ":" );
-                if ( tok.countTokens() != 2 )
+                int count = tok.countTokens();
+                if ( count != 2 && count != 3 )
                 {
-                    logger.warn( "Invalid default report ignored: '" + report + "' (must be groupId:artifactId)" );
+                    logger.warn( "Invalid default report ignored: '" + report + "' (must be groupId:artifactId[:version])" );
                 }
                 else
                 {
                     String groupId = tok.nextToken();
                     String artifactId = tok.nextToken();
+                    String version = tok.hasMoreTokens() ? tok.nextToken() : null;
 
                     boolean found = false;
                     for ( Iterator j = reportPlugins.iterator(); j.hasNext() && !found; )
@@ -509,6 +511,7 @@ public class DefaultLifecycleBindingManager
                         ReportPlugin reportPlugin = new ReportPlugin();
                         reportPlugin.setGroupId( groupId );
                         reportPlugin.setArtifactId( artifactId );
+                        reportPlugin.setVersion( version );
                         reportPlugins.add( reportPlugin );
                     }
                 }
diff --git a/maven-core/src/main/resources/META-INF/plexus/components.xml b/maven-core/src/main/resources/META-INF/plexus/components.xml
index 4bf5c3d18d..a3b36bdbc4 100644
--- a/maven-core/src/main/resources/META-INF/plexus/components.xml
+++ b/maven-core/src/main/resources/META-INF/plexus/components.xml
@@ -801,7 +801,7 @@ under the License.
         </lifecycles>
         <!-- START SNIPPET: default-reports -->
         <defaultReports>
-          <report>org.apache.maven.plugins:maven-project-info-reports-plugin</report>
+          <report>org.apache.maven.plugins:maven-project-info-reports-plugin:2.0.1</report>
           <!-- TODO: currently in mojo - should they be defaults any more?
           <report>org.apache.maven.plugins:maven-checkstyle-plugin</report>
           <report>org.apache.maven.plugins:maven-javadoc-plugin</report>