[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
This commit is contained in:
Benjamin Bentmann 2008-11-23 16:09:58 +00:00
parent c0bbd26f11
commit 9811be2c3e
2 changed files with 6 additions and 3 deletions

View File

@ -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 );
}
}

View File

@ -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>