Skip to content

Commit

Permalink
Use non-deprecated Sink class
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jan 3, 2023
1 parent 2fe99fd commit c2554a0
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
24 changes: 23 additions & 1 deletion maven-jellydoc-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

<properties>
<maven.version>3.8.7</maven.version>
<plexus.version>2.1.1</plexus.version>
<maven-plugin-tools.version>3.7.0</maven-plugin-tools.version>
<!-- TODO fix violations -->
<spotbugs.threshold>High</spotbugs.threshold>
Expand All @@ -75,6 +76,11 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
Expand All @@ -93,7 +99,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>2.1.1</version>
<version>${plexus.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>${plexus.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down Expand Up @@ -134,6 +145,17 @@
<artifactId>ant</artifactId>
<version>1.10.12</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
<version>1.11.1</version>
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkFactory;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.AbstractMojoExecutionException;
Expand All @@ -29,7 +31,7 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.reporting.MavenReport;
import org.apache.maven.reporting.MavenMultiPageReport;
import org.apache.maven.reporting.MavenReportException;
import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
Expand All @@ -38,7 +40,6 @@
import org.apache.tools.ant.taskdefs.Javadoc;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
import org.codehaus.doxia.sink.Sink;
import org.codehaus.plexus.util.FileUtils;
import org.dom4j.DocumentException;
import org.dom4j.Element;
Expand Down Expand Up @@ -67,7 +68,7 @@
*/
@Mojo(name = "jellydoc", requiresDependencyResolution = ResolutionScope.COMPILE)
@Execute(phase = LifecyclePhase.GENERATE_SOURCES)
public class JellydocMojo extends AbstractMojo implements MavenReport {
public class JellydocMojo extends AbstractMojo implements MavenMultiPageReport {
/**
* The Maven Project Object
*/
Expand Down Expand Up @@ -205,8 +206,43 @@ private void setParam(Javadoc.DocletInfo d, String name, String value) {
// return src;
// }

/**
* Generate a report.
*
* @param sink The sink to use for the generation.
* @param locale The desired locale in which to generate the report; could be null.
* @throws MavenReportException if any error occurs
* @deprecated use {@link #generate(Sink, SinkFactory, Locale)} instead.
*/
@Deprecated
@Override
public void generate(org.codehaus.doxia.sink.Sink sink, Locale locale) throws MavenReportException {
generate(sink, null, locale);
}

/**
* Generate a report.
*
* @param sink The sink to use for the generation.
* @param locale The desired locale in which to generate the report; could be null.
* @throws MavenReportException if any error occurs
* @deprecated use {@link #generate(Sink, SinkFactory, Locale)} instead.
*/
@Deprecated
public void generate(Sink sink, Locale locale) throws MavenReportException {
generate(sink, null, locale);
}

/**
* This method is called when the report generation is invoked by maven-site-plugin.
*
* @param sink The sink to use for the generation.
* @param sinkFactory The sink factory to use for the generation; could be null.
* @param locale The desired locale in which to generate the report; could be null.
* @throws MavenReportException if any error occurs
*/
@Override
public void generate(Sink sink, SinkFactory sinkFactory, Locale locale) throws MavenReportException {
try {
execute();
new ReferenceRenderer(sink,new File(targetDir(),"taglib.xml").toURI().toURL()).render();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
package org.jvnet.maven.jellydoc;

import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.reporting.AbstractMavenReportRenderer;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.codehaus.doxia.sink.Sink;

import java.net.URL;
import java.util.List;
Expand Down

0 comments on commit c2554a0

Please sign in to comment.