You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2013/04/07 11:29:45 UTC

svn commit: r1465350 - /maven/shared/trunk/maven-reporting-exec/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java

Author: hboutemy
Date: Sun Apr  7 09:29:44 2013
New Revision: 1465350

URL: http://svn.apache.org/r1465350
Log:
check reports duplicate and warn if necessary

Modified:
    maven/shared/trunk/maven-reporting-exec/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java

Modified: maven/shared/trunk/maven-reporting-exec/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-exec/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java?rev=1465350&r1=1465349&r2=1465350&view=diff
==============================================================================
--- maven/shared/trunk/maven-reporting-exec/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java (original)
+++ maven/shared/trunk/maven-reporting-exec/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java Sun Apr  7 09:29:44 2013
@@ -197,16 +197,32 @@ public class DefaultMavenReportExecutor
         }
         else
         {
+            Set<String> goals = new HashSet<String>();
             for ( String report : reportPlugin.getReports() )
             {
-                goalsWithConfiguration.add( new GoalWithConf( report, reportPlugin.getConfiguration() ) );
+                if ( goals.add( report ) )
+                {
+                    goalsWithConfiguration.add( new GoalWithConf( report, reportPlugin.getConfiguration() ) );
+                }
+                else
+                {
+                    logger.warn( report + " report is declared twice in default reports" );
+                }
             }
 
             for ( ReportSet reportSet : reportPlugin.getReportSets() )
             {
+                goals = new HashSet<String>();
                 for ( String report : reportSet.getReports() )
                 {
-                    goalsWithConfiguration.add( new GoalWithConf( report, reportSet.getConfiguration() ) );
+                    if ( goals.add( report ) )
+                    {
+                        goalsWithConfiguration.add( new GoalWithConf( report, reportSet.getConfiguration() ) );
+                    }
+                    else
+                    {
+                        logger.warn( report + " report is declared twice in " + reportSet.getId() + " reportSet" );
+                    }
                 }
             }
         }