maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject [15/28] maven git commit: [MNG-6189] warn if maven-site-plugin reportPlugins is configured
Date Sat, 01 Apr 2017 22:21:43 GMT
[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/ef6167e5
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ef6167e5
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ef6167e5

Branch: refs/heads/MNG-6169
Commit: ef6167e587477275b044444808eebc1b3bc8ba15
Parents: d1eb1ba
Author: Hervé Boutemy <hboutemy@apache.org>
Authored: Sun Mar 19 17:04:04 2017 +0100
Committer: Michael Osipov <michaelo@apache.org>
Committed: Sun Apr 2 00:21:12 2017 +0200

----------------------------------------------------------------------
 .../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/ef6167e5/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/ef6167e5/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}.


Mime
View raw message