svn commit: r1811484 - in /maven/plugins/trunk/maven-pdf-plugin/src: it/pdf-with-reporting-section/pom.xml main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1811484 - in /maven/plugins/trunk/maven-pdf-plugin/src: it/pdf-with-reporting-section/pom.xml main/java/org/apache/maven/plugins/pdf/PdfMojo.java

hboutemy
Author: hboutemy
Date: Sun Oct  8 12:34:09 2017
New Revision: 1811484

URL: http://svn.apache.org/viewvc?rev=1811484&view=rev
Log:
[MPDF-48] added skipKnownFailingReports parameter to ease diagnosing root cause of reports failures

Modified:
    maven/plugins/trunk/maven-pdf-plugin/src/it/pdf-with-reporting-section/pom.xml
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Modified: maven/plugins/trunk/maven-pdf-plugin/src/it/pdf-with-reporting-section/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/it/pdf-with-reporting-section/pom.xml?rev=1811484&r1=1811483&r2=1811484&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/it/pdf-with-reporting-section/pom.xml (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/it/pdf-with-reporting-section/pom.xml Sun Oct  8 12:34:09 2017
@@ -48,6 +48,9 @@ under the License.
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-pdf-plugin</artifactId>
         <version>@project.version@</version>
+        <configuration>
+          <!--skipKnownFailingReports>true</skipKnownFailingReports-->
+        </configuration>
       </plugin>
     </plugins>
   </build>
@@ -69,7 +72,6 @@ under the License.
               <report>dependencies</report>
               <report>dependency-info</report>
               <report>dependency-management</report>
-              <report>help</report>
               <report>issue-tracking</report>
               <report>license</report>
               <report>mailing-list</report>

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=1811484&r1=1811483&r2=1811484&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Sun Oct  8 12:34:09 2017
@@ -106,7 +106,7 @@ import org.codehaus.plexus.util.WriterFa
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Generates a PDF document for a project.
+ * Generates a PDF document for a project documentation usually published as web site (with maven-site-plugin).
  *
  * @author ltheussl
  * @version $Id$
@@ -119,11 +119,19 @@ public class PdfMojo
     /**
      * Workaround for reports that fail report generation
      * @see MavenReport#generate(org.codehaus.doxia.sink.Sink, java.util.Locale)
+     * @since 1.4
      */
     private final String[] failingReportClassName =
             { "DependenciesReport", "TeamListReport", "DependencyConvergenceReport" };
 
     /**
+     * Skip known failing reports (waiting to find the root cause and fix it).
+     * @since 1.4
+     */
+    @Parameter( defaultValue = "true" )
+    private boolean skipKnownFailingReports = true;
+
+    /**
      * The vm line separator
      */
     private static final String EOL = System.getProperty( "line.separator" );
@@ -1029,10 +1037,18 @@ public class PdfMojo
         // Workaround for reporters that fail report generation
         if ( skipFailingReport( report ) )
         {
-            getLog().info( "Skipped \"" + localReportName + "\" report (not supported by pdf plugin)." );
-            getLog().debug( "Skipped report simple class name: " + report.getClass().getSimpleName() );
-
-            return;
+            if ( skipKnownFailingReports )
+            {
+                getLog().info( "Skipped \"" + localReportName + "\" report (not supported by pdf plugin)." );
+                getLog().debug( "Skipped report simple class name: " + report.getClass().getSimpleName() );
+    
+                return;
+            }
+            else
+            {
+                getLog().warn( "Keeping \"" + localReportName
+                    + "\" report even if marked 'not supported by pdf plugin'" );
+            }
         }
 
         if ( !report.canGenerateReport() )
@@ -1045,7 +1061,7 @@ public class PdfMojo
 
         if ( report.isExternalReport() )
         {
-            getLog().info( "Skipped external \"" + localReportName + "\" report." );
+            getLog().info( "Skipped external \"" + localReportName + "\" report (not supported by pdf plugin)." );
             getLog().debug( "isExternalReport() was false." );
 
             return;