You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/06/04 18:06:57 UTC

[11/50] maven git commit: [MNG-6189] warn if maven-site-plugin reportPlugins is configured

[MNG-6189] warn if maven-site-plugin reportPlugins is configured

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/16382802
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/16382802
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/16382802

Branch: refs/heads/mvn-3.5.1/MNG-6174
Commit: 16382802611939a8876fe553208e8b0f4da606a6
Parents: abca6ab
Author: Hervé Boutemy <hb...@apache.org>
Authored: Sun Mar 19 17:04:04 2017 +0100
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Sun Mar 19 21:51:53 2017 +0100

----------------------------------------------------------------------
 .../maven/model/plugin/DefaultReportingConverter.java  | 13 +++++++++++--
 .../apache/maven/model/plugin/ReportingConverter.java  |  5 +++--
 2 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/16382802/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
index d918d9e..8bfa580 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
@@ -28,12 +28,16 @@ import org.apache.maven.model.ReportSet;
 import org.apache.maven.model.Reporting;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.ModelProblemCollector;
+import org.apache.maven.model.building.ModelProblemCollectorRequest;
+import org.apache.maven.model.building.ModelProblem.Severity;
+import org.apache.maven.model.building.ModelProblem.Version;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
 /**
- * Handles conversion of the legacy reporting section into the configuration of the new Maven Site Plugin.
+ * Handles conversion of the <code>&lt;reporting&gt;</code> section into the configuration of Maven Site Plugin 3.x,
+ * i.e. <code>reportPlugins</code> and <code>outputDirectory</code> parameters.
  *
  * @author Benjamin Bentmann
  */
@@ -87,7 +91,12 @@ public class DefaultReportingConverter
 
         if ( reportPlugins != null )
         {
-            // new-style report configuration already present, assume user handled entire conversion
+            // new-style report configuration already present: warn since this new style has been deprecated
+            // in favor of classical reporting section MSITE-647 / MSITE-684
+            problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.BASE )
+                    .setMessage( "Reporting configuration should be done in <reporting> section, "
+                          + "not in maven-site-plugin <configuration> as reportPlugins parameter." )
+                    .setLocation( sitePlugin.getLocation( "configuration" ) ) );
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/maven/blob/16382802/maven-model-builder/src/main/java/org/apache/maven/model/plugin/ReportingConverter.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/ReportingConverter.java b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/ReportingConverter.java
index c5ea338..e6d8898 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/ReportingConverter.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/ReportingConverter.java
@@ -24,7 +24,8 @@ import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
- * Handles conversion of the legacy reporting section into the configuration of the new Maven Site Plugin.
+ * Handles conversion of the <code>&lt;reporting&gt;</code> section into the configuration of Maven Site Plugin 3.x,
+ * i.e. <code>reportPlugins</code> and <code>outputDirectory</code> parameters.
  *
  * @author Benjamin Bentmann
  */
@@ -32,7 +33,7 @@ public interface ReportingConverter
 {
 
     /**
-     * Converts values from model's reporting section into the configuration for the new Maven Site Plugin.
+     * Converts values from model's reporting section into the configuration for Maven Site Plugin 3.x.
      *
      * @param model The model whose reporting section should be converted, must not be <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.