svn commit: r1811485 - 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: r1811485 - 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:46:35 2017
New Revision: 1811485

URL: http://svn.apache.org/viewvc?rev=1811485&view=rev
Log:
[MPDF-48] fixed first cause of failing reports: use reportExec.canGenerateReport() to have proper classloader context

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=1811485&r1=1811484&r2=1811485&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:46:35 2017
@@ -37,6 +37,31 @@ under the License.
     <url>http://www.apache.org/</url>
   </organization>
 
+  <contributors>
+    <contributor>
+      <name>Sébastien Garelle</name>
+    </contributor>
+  </contributors>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-pdf-plugin/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-pdf-plugin/</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/</url>
+  </scm>
+  <issueManagement>
+    <system>JIRA</system>
+    <url>https://issues.apache.org/jira/browse/MPDF</url>
+  </issueManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
   <build>
     <plugins>
       <plugin>
@@ -49,7 +74,7 @@ under the License.
         <artifactId>maven-pdf-plugin</artifactId>
         <version>@project.version@</version>
         <configuration>
-          <!--skipKnownFailingReports>true</skipKnownFailingReports-->
+          <!--skipKnownFailingReports>false</skipKnownFailingReports-->
         </configuration>
       </plugin>
     </plugins>

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=1811485&r1=1811484&r2=1811485&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:46:35 2017
@@ -1007,7 +1007,7 @@ public class PdfMojo
         List<MavenReportExecution> reports = getReports();
         for ( MavenReportExecution report : reports )
         {
-            generateMavenReport( report.getMavenReport(), locale );
+            generateMavenReport( report, locale );
         }
 
         // copy generated site
@@ -1018,19 +1018,16 @@ public class PdfMojo
     /**
      * Generate the given Maven report only if it is not an external report and the report could be generated.
      *
-     * @param report could be null
+     * @param reportExec not null
      * @param locale not null
      * @throws IOException if any
      * @throws MojoExecutionException if any
      * @since 1.1
      */
-    private void generateMavenReport( MavenReport report, Locale locale )
+    private void generateMavenReport( MavenReportExecution reportExec, Locale locale )
         throws IOException, MojoExecutionException
     {
-        if ( report == null )
-        {
-            return;
-        }
+        MavenReport report = reportExec.getMavenReport();
 
         String localReportName = report.getName( locale );
 
@@ -1051,7 +1048,7 @@ public class PdfMojo
             }
         }
 
-        if ( !report.canGenerateReport() )
+        if ( !reportExec.canGenerateReport() )
         {
             getLog().info( "Skipped \"" + localReportName + "\" report." );
             getLog().debug( "canGenerateReport() was false." );