You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2008/09/15 22:29:31 UTC

svn commit: r695609 - in /maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins: AbstractPluginConfigurationConverter.java PCCChanges.java

Author: dennisl
Date: Mon Sep 15 13:29:30 2008
New Revision: 695609

URL: http://svn.apache.org/viewvc?rev=695609&view=rev
Log:
[MSHARED-70] Allow the conversion of report plugins to specify reportSets

Modified:
    maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/AbstractPluginConfigurationConverter.java
    maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCChanges.java

Modified: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/AbstractPluginConfigurationConverter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/AbstractPluginConfigurationConverter.java?rev=695609&r1=695608&r2=695609&view=diff
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/AbstractPluginConfigurationConverter.java (original)
+++ maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/AbstractPluginConfigurationConverter.java Mon Sep 15 13:29:30 2008
@@ -31,6 +31,7 @@
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
@@ -157,6 +158,11 @@
 
                 plugin.setConfiguration( configuration );
 
+                if ( getReportSets() != null && !getReportSets().isEmpty() )
+                {
+                    plugin.setReportSets( getReportSets() );
+                }
+
                 if ( addPlugin )
                 {
                     if ( v4Model.getReporting() == null )
@@ -175,6 +181,18 @@
                                                 Properties projectProperties )
         throws ProjectConverterException;
 
+
+    /**
+     * Get the report sets for this plugin. Override this method if the
+     * plugin you are converting needs report sets.
+     *
+     * @return This default implementation simply returns an empty list
+     */
+    protected List getReportSets()
+    {
+        return Collections.EMPTY_LIST;
+    }
+
     private void sendInfoMessage( String message )
     {
         getLogger().info( message );

Modified: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCChanges.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCChanges.java?rev=695609&r1=695608&r2=695609&view=diff
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCChanges.java (original)
+++ maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCChanges.java Mon Sep 15 13:29:30 2008
@@ -19,9 +19,12 @@
  * under the License.
  */
 
+import org.apache.maven.model.ReportSet;
 import org.apache.maven.model.converter.ProjectConverterException;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 
 /**
@@ -55,4 +58,15 @@
         addConfigurationChild( configuration, projectProperties, "maven.changes.issue.template", "issueLinkTemplate" );
         addConfigurationChild( configuration, "xmlPath", "${basedir}/xdocs/changes.xml" );
     }
+
+    protected List getReportSets()
+    {
+        List reportSets = new ArrayList();
+
+        ReportSet reportSet = new ReportSet();
+        reportSet.addReport( "changes-report" );
+        reportSets.add( reportSet );
+
+        return reportSets;
+    }
 }