Bundles the Javadoc documentation for main Java code
in an aggregator project into a jar
@@ -39,6 +50,32 @@
requiresDependencyResolution = ResolutionScope.COMPILE)
@Execute(phase = LifecyclePhase.COMPILE)
public class AggregatorJavadocJarMojo extends JavadocJarMojo {
+
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public AggregatorJavadocJarMojo(
+ MavenProjectHelper projectHelper,
+ JarArchiver jarArchiver,
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ projectHelper,
+ jarArchiver,
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
@Override
protected boolean isAggregator() {
return true;
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocNoForkReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocNoForkReport.java
index 2a4be07e..f062baa8 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocNoForkReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocNoForkReport.java
@@ -18,10 +18,19 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
* Generates documentation for the Java code
in an aggregator project using the standard
@@ -31,4 +40,27 @@
*/
@Mojo(name = "aggregate-no-fork", requiresDependencyResolution = ResolutionScope.COMPILE)
@Execute(phase = LifecyclePhase.NONE)
-public class AggregatorJavadocNoForkReport extends AggregatorJavadocReport {}
+public class AggregatorJavadocNoForkReport extends AggregatorJavadocReport {
+
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public AggregatorJavadocNoForkReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
+}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
index 642c3ae1..4bd99e8d 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
@@ -18,10 +18,19 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
*
Generates documentation for the Java code
in an aggregator project using the standard
@@ -35,6 +44,26 @@
@Mojo(name = "aggregate", aggregator = true, requiresDependencyResolution = ResolutionScope.COMPILE)
@Execute(phase = LifecyclePhase.COMPILE)
public class AggregatorJavadocReport extends JavadocReport {
+
+ @Inject
+ public AggregatorJavadocReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+
@Override
protected boolean isAggregator() {
return true;
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJarMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJarMojo.java
index dba34342..f1a21ce1 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJarMojo.java
@@ -18,10 +18,21 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
*
Bundles the Javadoc documentation for Java Test code
in an aggregator project into a jar
@@ -39,6 +50,32 @@
requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase = LifecyclePhase.TEST_COMPILE)
public class AggregatorTestJavadocJarMojo extends TestJavadocJarMojo {
+
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public AggregatorTestJavadocJarMojo(
+ MavenProjectHelper projectHelper,
+ JarArchiver jarArchiver,
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ projectHelper,
+ jarArchiver,
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
@Override
protected boolean isAggregator() {
return true;
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocNoForkReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocNoForkReport.java
index 1cd104ca..0ac6aca1 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocNoForkReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocNoForkReport.java
@@ -18,10 +18,19 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
* Generates documentation for the Java Test code
in an aggregator project using the standard
@@ -32,4 +41,24 @@
*/
@Mojo(name = "test-aggregate-no-fork", requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase = LifecyclePhase.NONE)
-public class AggregatorTestJavadocNoForkReport extends AggregatorTestJavadocReport {}
+public class AggregatorTestJavadocNoForkReport extends AggregatorTestJavadocReport {
+
+ @Inject
+ public AggregatorTestJavadocNoForkReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
index 3829d46a..06db5a72 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
@@ -18,10 +18,19 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
*
Generates documentation for the Java Test code
in an aggregator project using the standard
@@ -35,6 +44,26 @@
@Mojo(name = "test-aggregate", aggregator = true, requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase = LifecyclePhase.TEST_COMPILE)
public class AggregatorTestJavadocReport extends TestJavadocReport {
+
+ @Inject
+ public AggregatorTestJavadocReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+
@Override
protected boolean isAggregator() {
return true;
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java
index 0deafadd..99511c1a 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java
@@ -18,10 +18,13 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.codehaus.plexus.components.interactivity.InputHandler;
/**
* Fix Javadoc documentation and tags for the Java code
for the project.
@@ -33,5 +36,9 @@
@Mojo(name = "fix", requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true)
@Execute(phase = LifecyclePhase.COMPILE)
public class FixJavadocMojo extends AbstractFixJavadocMojo {
- // nop
+
+ @Inject
+ public FixJavadocMojo(InputHandler inputHandler) {
+ super(inputHandler);
+ }
}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java
index 02a1ff99..3d840ac0 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import java.io.File;
import java.io.IOException;
import java.util.List;
@@ -26,20 +28,24 @@
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
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.plugins.javadoc.resolver.ResourceResolver;
import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.plexus.archiver.Archiver;
+import org.apache.maven.toolchain.ToolchainManager;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.archiver.jar.ManifestException;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
* Bundles the Javadoc documentation for main Java code
in an NON aggregator project into
@@ -79,7 +85,6 @@ public class JavadocJarMojo extends AbstractJavadocMojo {
/**
* Used for attaching the artifact in the project.
*/
- @Component
private MavenProjectHelper projectHelper;
/**
@@ -87,9 +92,33 @@ public class JavadocJarMojo extends AbstractJavadocMojo {
*
* @since 2.5
*/
- @Component(role = Archiver.class, hint = "jar")
private JarArchiver jarArchiver;
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public JavadocJarMojo(
+ MavenProjectHelper projectHelper,
+ JarArchiver jarArchiver,
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ this.projectHelper = projectHelper;
+ this.jarArchiver = jarArchiver;
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
// ----------------------------------------------------------------------
// Mojo Parameters
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java
index 4410e12f..b7b145fb 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java
@@ -18,13 +18,22 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
- * Generates documentation for the Java code
in an NON aggregator project using the standard
+ * Generates documentation for the Java code
in a NON aggregator project using the standard
* Javadoc Tool. Note that this
* goal does require generation of sources before site generation, e.g. by invoking {@code mvn clean deploy site}.
*
@@ -35,4 +44,24 @@
*/
@Mojo(name = "javadoc-no-fork", requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true)
@Execute(phase = LifecyclePhase.NONE)
-public class JavadocNoForkReport extends JavadocReport {}
+public class JavadocNoForkReport extends JavadocReport {
+
+ @Inject
+ public JavadocNoForkReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+}
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 5c0ca5b1..616b7859 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import java.io.File;
import java.nio.file.Path;
import java.util.Collection;
@@ -26,6 +28,7 @@
import java.util.ResourceBundle;
import java.util.stream.Collectors;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkFactory;
import org.apache.maven.doxia.siterenderer.DocumentRenderingContext;
@@ -38,8 +41,13 @@
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.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.reporting.MavenMultiPageReport;
import org.apache.maven.reporting.MavenReportException;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
* Generates documentation for the Java code
in a NON aggregator project using the standard
@@ -78,6 +86,25 @@ public class JavadocReport extends AbstractJavadocMojo implements MavenMultiPage
@Parameter(property = "description")
private String description;
+ @Inject
+ public JavadocReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+
// ----------------------------------------------------------------------
// Report public methods
// ----------------------------------------------------------------------
@@ -103,6 +130,7 @@ public String getDescription(Locale locale) {
}
/** {@inheritDoc} */
+ @Override
public void generate(Sink sink, Locale locale) throws MavenReportException {
generate(sink, null, locale);
}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
index 7c723c24..c8178dd6 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
@@ -1045,7 +1045,7 @@ private static String getMavenHome(Log log) {
File m2Home = new File(mavenHome);
if (!m2Home.exists()) {
if (log != null && log.isErrorEnabled()) {
- log.error("Cannot find Maven application directory. Either specify 'maven.home' system property.");
+ log.error("Cannot find Maven application directory. Specify 'maven.home' system property.");
}
}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java
index 6697e659..cf1d1ce4 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java
@@ -18,22 +18,29 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import java.io.File;
import java.io.IOException;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
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.plugins.javadoc.resolver.ResourceResolver;
import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
import org.codehaus.plexus.archiver.util.DefaultFileSet;
+import org.eclipse.aether.RepositorySystem;
/**
* Bundle {@link AbstractJavadocMojo#javadocDirectory}, along with javadoc configuration options such
@@ -72,15 +79,37 @@ public class ResourcesBundleMojo extends AbstractJavadocMojo {
* Helper component to provide an easy mechanism for attaching an artifact to the project for
* installation/deployment.
*/
- @Component
private MavenProjectHelper projectHelper;
/**
* Archiver manager, used to manage jar builder.
*/
- @Component
private ArchiverManager archiverManager;
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public ResourcesBundleMojo(
+ MavenProjectHelper projectHelper,
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ this.archiverManager = archiverManager;
+ this.projectHelper = projectHelper;
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
/**
* Assemble a new {@link org.apache.maven.plugins.javadoc.options.JavadocOptions JavadocOptions} instance that
* contains the configuration options in this
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java
index 4ff18ec3..2eea8800 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -30,6 +32,7 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.components.interactivity.InputHandler;
/**
* Fix Javadoc documentation and tags for the Test Java code
for the project.
@@ -41,6 +44,12 @@
@Mojo(name = "test-fix", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true)
@Execute(phase = LifecyclePhase.TEST_COMPILE)
public class TestFixJavadocMojo extends AbstractFixJavadocMojo {
+
+ @Inject
+ public TestFixJavadocMojo(InputHandler inputHandler) {
+ super(inputHandler);
+ }
+
/** {@inheritDoc} */
@Override
protected Listtest Java code
in an NON aggregator project into
+ * Bundles the Javadoc documentation for test Java code
in a NON aggregator project into
* a jar using the standard
* Javadoc Tool.
*
@@ -48,6 +59,32 @@
requiresDependencyResolution = ResolutionScope.TEST,
threadSafe = true)
public class TestJavadocJarMojo extends JavadocJarMojo {
+
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public TestJavadocJarMojo(
+ MavenProjectHelper projectHelper,
+ JarArchiver jarArchiver,
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ projectHelper,
+ jarArchiver,
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
// ----------------------------------------------------------------------
// Javadoc Options (should be inline with Javadoc options defined in TestJavadocReport)
// ----------------------------------------------------------------------
@@ -177,7 +214,7 @@ protected ScopeDependencyFilter getDependencyScopeFilter() {
}
/**
- * Overriden to enable the resolution of -test-sources jar files.
+ * Overridden to enable the resolution of -test-sources jar files.
*
* {@inheritDoc}
*/
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java
index f86b4832..bc78361c 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java
@@ -18,10 +18,19 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
* Generates documentation for the Java Test code
in an NON aggregator project using the standard
@@ -36,4 +45,25 @@
*/
@Mojo(name = "test-javadoc-no-fork", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true)
@Execute(phase = LifecyclePhase.NONE)
-public class TestJavadocNoForkReport extends TestJavadocReport {}
+public class TestJavadocNoForkReport extends TestJavadocReport {
+
+ @Inject
+ public TestJavadocNoForkReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ // TODO Auto-generated constructor stub
+ }
+}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java
index 63d1d659..4c8f900c 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@@ -28,19 +30,26 @@
import java.util.ResourceBundle;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
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.plugins.javadoc.resolver.ResourceResolver;
import org.apache.maven.plugins.javadoc.resolver.SourceResolverConfig;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.reporting.MavenReportException;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.util.StringUtils;
+import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.util.filter.ScopeDependencyFilter;
/**
- * Generates documentation for the Java Test code
in an NON aggregator project using the standard
+ * Generates documentation for the Java Test code
in a NON aggregator project using the standard
* Javadoc Tool.
*
* @author Vincent Siveton
@@ -130,6 +139,25 @@ public class TestJavadocReport extends JavadocReport {
// Report public methods
// ----------------------------------------------------------------------
+ @Inject
+ public TestJavadocReport(
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+
@Override
protected void executeReport(Locale unusedLocale) throws MavenReportException {
addMainJavadocLink();
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestResourcesBundleMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/TestResourcesBundleMojo.java
index 64a66e15..d8846aa7 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestResourcesBundleMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestResourcesBundleMojo.java
@@ -18,12 +18,22 @@
*/
package org.apache.maven.plugins.javadoc;
+import javax.inject.Inject;
+
import java.io.File;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.plugins.annotations.LifecyclePhase;
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.plugins.javadoc.resolver.ResourceResolver;
+import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.eclipse.aether.RepositorySystem;
/**
* Bundle {@link TestJavadocJarMojo#testJavadocDirectory}, along with javadoc configuration options from
@@ -41,6 +51,29 @@
threadSafe = true)
public class TestResourcesBundleMojo extends ResourcesBundleMojo {
+ // CHECKSTYLE_OFF: ParameterNumber
+ @Inject
+ public TestResourcesBundleMojo(
+ MavenProjectHelper projectHelper,
+ SiteTool siteTool,
+ ArchiverManager archiverManager,
+ ResourceResolver resourceResolver,
+ RepositorySystem repoSystem,
+ ArtifactHandlerManager artifactHandlerManager,
+ ProjectBuilder mavenProjectBuilder,
+ ToolchainManager toolchainManager) {
+ super(
+ projectHelper,
+ siteTool,
+ archiverManager,
+ resourceResolver,
+ repoSystem,
+ artifactHandlerManager,
+ mavenProjectBuilder,
+ toolchainManager);
+ }
+ // CHECKSTYLE_ON: ParameterNumber
+
/**
* Specifies the Test Javadoc resources directory to be included in the Javadoc (i.e. package.html, images...).
*/
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java
index 8a6d5b4c..d21ba29d 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java
@@ -37,7 +37,7 @@ public class AbstractJavadocMojoTest {
@Before
public void setUp() {
- mojo = new AbstractJavadocMojo() {
+ mojo = new AbstractJavadocMojo(null, null, null, null, null, null, null) {
@Override
public void doExecute() {}
};
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
index eedad881..b9ad5ab9 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
@@ -319,7 +319,7 @@ public void testJavadocComment() throws Throwable {
assertEquals(5, javaMethod.getTags().size());
- AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo();
+ AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo(null);
setVariableValueToObject(mojoInstance, "fixTagsSplitted", new String[] {"all"});
DocletTag tag = javaMethod.getTags().get(0);
@@ -383,7 +383,7 @@ public void testJavadocCommentJdk5() throws Exception {
assertEquals(4, javaMethod.getTags().size());
- AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo();
+ AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo(null);
setVariableValueToObject(mojoInstance, "fixTagsSplitted", new String[] {"all"});
DocletTag tag = javaMethod.getTags().get(0);
@@ -404,7 +404,7 @@ public void testJavadocCommentJdk5() throws Exception {
}
public void testInitParameters() throws Throwable {
- AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo();
+ AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo(null);
setVariableValueToObject(mojoInstance, "fixTags", "author, version, since, param, return, throws, link");
setVariableValueToObject(mojoInstance, "defaultSince", "1.0");
setVariableValueToObject(mojoInstance, "level", "protected");
@@ -431,7 +431,7 @@ public void testInitParameters() throws Throwable {
}
public void testRemoveUnknownExceptions() throws Exception {
- AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo();
+ AbstractFixJavadocMojo mojoInstance = new FixJavadocMojo(null);
setVariableValueToObject(mojoInstance, "fixTagsSplitted", new String[] {"all"});
setVariableValueToObject(mojoInstance, "project", new MavenProjectStub());