diff --git a/pom.xml b/pom.xml index cc763f61c..8fb6bbc32 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ under the License. 1.1.0 9.4.43.v20210629 - 3.11.0 + 3.12.1 3.2.2 2022-04-17T07:43:18Z 1.7.32 @@ -207,7 +207,7 @@ under the License. org.apache.maven.reporting maven-reporting-api - 3.1.0 + 3.1.1 org.apache.maven 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 7be50290e..4ba2f67c4 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import org.apache.maven.doxia.sink.Sink; +import org.apache.maven.doxia.sink.SinkFactory; import org.apache.maven.doxia.siterenderer.RenderingContext; import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; import org.apache.maven.plugin.MojoExecutionException; @@ -37,7 +38,7 @@ import org.apache.maven.plugins.annotations.Mojo; 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.MavenMultiPageReport; import org.apache.maven.reporting.MavenReportException; import org.codehaus.plexus.util.StringUtils; @@ -55,7 +56,7 @@ @Execute( phase = LifecyclePhase.GENERATE_SOURCES ) public class JavadocReport extends AbstractJavadocMojo - implements MavenReport + implements MavenMultiPageReport { // ---------------------------------------------------------------------- // Report Mojo Parameters @@ -125,8 +126,22 @@ public String getDescription( Locale locale ) /** {@inheritDoc} */ @Override + public void generate( org.codehaus.doxia.sink.Sink sink, Locale locale ) + throws MavenReportException + { + generate( sink, null, locale ); + } + public void generate( Sink sink, Locale locale ) throws MavenReportException + { + generate( sink, null, locale ); + } + + /** {@inheritDoc} */ + @Override + public void generate( Sink sink, SinkFactory sinkFactory, Locale locale ) + throws MavenReportException { outputDirectory = getReportOutputDirectory(); @@ -316,12 +331,21 @@ public void doExecute() return; } + File outputDirectory = new File( getOutputDirectory() ); + + String filename = getOutputName() + ".html"; + + Locale locale = Locale.getDefault(); + try { - RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html" ); - SiteRendererSink sink = new SiteRendererSink( context ); - Locale locale = Locale.getDefault(); - generate( sink, locale ); + // TODO Replace null with real value + RenderingContext docRenderingContext = new RenderingContext( outputDirectory, filename, null ); + + SiteRendererSink sink = new SiteRendererSink( docRenderingContext ); + + generate( sink, null, locale ); + } catch ( MavenReportException | RuntimeException e ) {