check reports duplicate and warn if necessary
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1465350 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
index b27f6cc..e8bba45 100644
--- a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
+++ b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
@@ -197,16 +197,32 @@
}
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" );
+ }
}
}
}