[java-parent-project] branch main updated: JPAR-206 - Update maven-javadoc-plugin to reporting API 3.1.0

Phil Smart philip.smart at jisc.ac.uk
Mon Apr 25 09:54:45 UTC 2022


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-parent-project.

View the commit online:
http://git.shibboleth.net/view/?p=java-parent-project.git;a=commit;h=cb8fa982f9d0e0990c56a1eed6358a5a42e73c40

The following commit(s) were added to refs/heads/main by this push:
     new cb8fa98  JPAR-206 - Update maven-javadoc-plugin to reporting API 3.1.0
cb8fa98 is described below

commit cb8fa982f9d0e0990c56a1eed6358a5a42e73c40
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Apr 25 10:54:39 2022 +0100

    JPAR-206 - Update maven-javadoc-plugin to reporting API 3.1.0
    
    Add second patch file for the javadoc plugin to support reporting API
    3.1.0 and retain backward compatibility with 3.0.0 (and possibly older).
    
    https://shibboleth.atlassian.net/browse/JPAR-206
---
 ...date-maven-javadoc-plugin-to-reporting-AP.patch | 156 +++++++++++++++++++++
 1 file changed, 156 insertions(+)

diff --git a/resources/maven/0001-JPAR-206-Update-maven-javadoc-plugin-to-reporting-AP.patch b/resources/maven/0001-JPAR-206-Update-maven-javadoc-plugin-to-reporting-AP.patch
new file mode 100644
index 0000000..4494737
--- /dev/null
+++ b/resources/maven/0001-JPAR-206-Update-maven-javadoc-plugin-to-reporting-AP.patch
@@ -0,0 +1,156 @@
+From 24e3170e97621769287f01952cc881655d30e6c6 Mon Sep 17 00:00:00 2001
+From: Phil Smart <philip.smart at jisc.ac.uk>
+Date: Thu, 14 Apr 2022 12:57:47 +0100
+Subject: [PATCH 1/1] JPAR-206 - Update maven-javadoc-plugin to reporting API
+ 3.1.0
+
+Fix maven reporting API changes
+
+https://shibboleth.atlassian.net/browse/JPAR-206
+https://issues.apache.org/jira/browse/MJAVADOC-705
+---
+ pom.xml                                       |  4 +--
+ .../maven/plugins/javadoc/JavadocReport.java  | 30 +++++++++++--------
+ 2 files changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/pom.xml b/pom.xml
+index c0baffdf..53acd4f3 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -31,7 +31,7 @@ under the License.
+ 
+   <groupId>net.shibboleth.maven.plugins</groupId>
+   <artifactId>maven-javadoc-plugin</artifactId>
+-  <version>3.3.0</version>
++  <version>3.3.0.2</version>
+   <packaging>maven-plugin</packaging>
+ 
+   <name>Apache Maven Javadoc Plugin</name>
+@@ -197,7 +197,7 @@ under the License.
+     <dependency>
+       <groupId>org.apache.maven.reporting</groupId>
+       <artifactId>maven-reporting-api</artifactId>
+-      <version>3.0</version>
++      <version>3.1.0</version>
+     </dependency>
+     <dependency>
+       <groupId>org.apache.maven</groupId>
+diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
+index 7b101700..56d1efaa 100644
+--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
++++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
+@@ -27,6 +27,7 @@ import java.util.Map;
+ import java.util.ResourceBundle;
+ import java.util.stream.Collectors;
+ 
++import org.apache.maven.doxia.sink.Sink;
+ import org.apache.maven.doxia.siterenderer.RenderingContext;
+ import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
+ import org.apache.maven.plugin.MojoExecutionException;
+@@ -38,7 +39,6 @@ import org.apache.maven.plugins.annotations.Parameter;
+ import org.apache.maven.plugins.annotations.ResolutionScope;
+ import org.apache.maven.reporting.MavenReport;
+ import org.apache.maven.reporting.MavenReportException;
+-import org.codehaus.doxia.sink.Sink;
+ import org.codehaus.plexus.util.StringUtils;
+ 
+ /**
+@@ -101,7 +101,7 @@ public class JavadocReport
+ 
+     /** {@inheritDoc} */
+     @Override
+-    public String getName( Locale locale )
++    public String getName( final Locale locale )
+     {
+         if ( StringUtils.isEmpty( name ) )
+         {
+@@ -113,7 +113,7 @@ public class JavadocReport
+ 
+     /** {@inheritDoc} */
+     @Override
+-    public String getDescription( Locale locale )
++    public String getDescription( final Locale locale )
+     {
+         if ( StringUtils.isEmpty( description ) )
+         {
+@@ -125,7 +125,7 @@ public class JavadocReport
+ 
+     /** {@inheritDoc} */
+     @Override
+-    public void generate( Sink sink, Locale locale )
++    public void generate( final Sink sink, final Locale locale )
+         throws MavenReportException
+     {
+         outputDirectory = getReportOutputDirectory();
+@@ -143,6 +143,12 @@ public class JavadocReport
+             getLog().error( "Error while creating javadoc report: " + e.getMessage(), e );
+         }
+     }
++    
++    public void generate( final org.codehaus.doxia.sink.Sink sink, final Locale locale )
++            throws MavenReportException
++        {
++            generate( (Sink) sink, locale );
++        }
+ 
+     /** {@inheritDoc} */
+     @Override
+@@ -238,7 +244,7 @@ public class JavadocReport
+                                 .collect( Collectors.toList() );
+                 files = getFiles( sourcePaths );
+             }
+-            catch ( MavenReportException e )
++            catch ( final MavenReportException e )
+             {
+                 getLog().error( e.getMessage(), e );
+                 return false;
+@@ -278,7 +284,7 @@ public class JavadocReport
+      * @param reportOutputDirectory the directory file to be set
+      */
+     @Override
+-    public void setReportOutputDirectory( File reportOutputDirectory )
++    public void setReportOutputDirectory( final File reportOutputDirectory )
+     {
+         updateReportOutputDirectory( reportOutputDirectory, destDir );
+     }
+@@ -286,13 +292,13 @@ public class JavadocReport
+     /**
+      * @param theDestDir The destination directory.
+      */
+-    public void setDestDir( String theDestDir )
++    public void setDestDir( final String theDestDir )
+     {
+         this.destDir = theDestDir;
+         updateReportOutputDirectory( reportOutputDirectory, theDestDir );
+     }
+ 
+-    private void updateReportOutputDirectory( File reportOutputDirectory, String destDir )
++    private void updateReportOutputDirectory( final File reportOutputDirectory, final String destDir )
+     {
+         if ( reportOutputDirectory != null && destDir != null
+              && !reportOutputDirectory.getAbsolutePath().endsWith( destDir ) )
+@@ -318,9 +324,9 @@ public class JavadocReport
+ 
+         try
+         {
+-            RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html" );
+-            SiteRendererSink sink = new SiteRendererSink( context );
+-            Locale locale = Locale.getDefault();
++            final RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html" );
++            final SiteRendererSink sink = new SiteRendererSink( context );
++            final Locale locale = Locale.getDefault();
+             generate( sink, locale );
+         }
+         catch ( MavenReportException | RuntimeException e )
+@@ -335,7 +341,7 @@ public class JavadocReport
+      * @param locale The locale of the currently generated report.
+      * @return The resource bundle for the requested locale.
+      */
+-    private ResourceBundle getBundle( Locale locale )
++    private ResourceBundle getBundle( final Locale locale )
+     {
+         return ResourceBundle.getBundle( "javadoc-report", locale, getClass().getClassLoader() );
+     }
+-- 
+2.30.1 (Apple Git-130)
+

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list