maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1612089 - /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/
Date Sun, 20 Jul 2014 14:22:58 GMT
Author: hboutemy
Date: Sun Jul 20 14:22:57 2014
New Revision: 1612089

URL: http://svn.apache.org/r1612089
Log:
[MPIR-297] added skip parameter

Modified:
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
Sun Jul 20 14:22:57 2014
@@ -50,7 +50,6 @@ import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -60,6 +59,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.text.MessageFormat;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
@@ -162,11 +162,25 @@ public abstract class AbstractProjectInf
     @Parameter( defaultValue = "${project.basedir}/src/site/custom/project-info-report.properties"
)
     protected String customBundle;
 
+    /**
+     * Skip report.
+     *
+     * @since 2.8
+     */
+    @Parameter( property = "mpir.skip", defaultValue = "false" )
+    private boolean skip;
+
     // ----------------------------------------------------------------------
     // Public methods
     // ----------------------------------------------------------------------
 
     @Override
+    public boolean canGenerateReport()
+    {
+        return !skip;
+    }
+
+    @Override
     public void execute()
         throws MojoExecutionException
     {
@@ -246,6 +260,11 @@ public abstract class AbstractProjectInf
     // Protected methods
     // ----------------------------------------------------------------------
 
+    protected boolean isEmpty( Collection<?> coll )
+    {
+        return coll == null || coll.isEmpty();
+    }
+
     @Override
     protected String getOutputDirectory()
     {

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
Sun Jul 20 14:22:57 2014
@@ -134,8 +134,8 @@ public class DependencyConvergenceReport
     @Override
     public boolean canGenerateReport()
     {
-        // should generate the convergency report, even its single maven project.
-        return reactorProjects.size() >= 1;
+        // should generate the convergency report, even its single Maven project.
+        return super.canGenerateReport() && reactorProjects.size() >= 1;
     }
 
     // ----------------------------------------------------------------------

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
Sun Jul 20 14:22:57 2014
@@ -129,7 +129,7 @@ public class DependencyManagementReport
     @Override
     public boolean canGenerateReport()
     {
-        return getManagementDependencies().hasDependencies();
+        return super.canGenerateReport() && getManagementDependencies().hasDependencies();
     }
 
     // ----------------------------------------------------------------------

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
Sun Jul 20 14:22:57 2014
@@ -93,6 +93,11 @@ public class LicenseReport
     @Override
     public boolean canGenerateReport()
     {
+        if ( !super.canGenerateReport() )
+        {
+            return false;
+        }
+
         if ( !offline )
         {
             return true;

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
Sun Jul 20 14:22:57 2014
@@ -65,7 +65,7 @@ public class ModulesReport
     @Override
     public boolean canGenerateReport()
     {
-        return ( getProject().getModel().getModules() != null && !getProject().getModel().getModules().isEmpty()
);
+        return !isEmpty( getProject().getModel().getModules() );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
Sun Jul 20 14:22:57 2014
@@ -97,8 +97,8 @@ public class PluginManagementReport
     @Override
     public boolean canGenerateReport()
     {
-        return project.getPluginManagement() != null && project.getPluginManagement().getPlugins()
!= null
-            && !project.getPluginManagement().getPlugins().isEmpty();
+        return super.canGenerateReport() && project.getPluginManagement() != null
+            && !isEmpty( project.getPluginManagement().getPlugins() );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java?rev=1612089&r1=1612088&r2=1612089&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java
Sun Jul 20 14:22:57 2014
@@ -98,8 +98,8 @@ public class PluginsReport
     @Override
     public boolean canGenerateReport()
     {
-        return ( project.getPluginArtifacts() != null && !project.getPluginArtifacts().isEmpty()
)
-            || ( project.getReportArtifacts() != null && !project.getReportArtifacts().isEmpty()
);
+        return super.canGenerateReport()
+            && !( isEmpty( project.getPluginArtifacts() ) && isEmpty( project.getReportArtifacts()
) );
     }
 
     // ----------------------------------------------------------------------



Mime
View raw message