diff --git a/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java b/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java index 9f3168b2..49f81473 100644 --- a/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java +++ b/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java @@ -18,6 +18,8 @@ */ package org.apache.maven.plugins.site.render; +import javax.inject.Inject; + import java.io.File; import java.io.IOException; @@ -26,13 +28,11 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException; 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.project.MavenProjectHelper; -import org.codehaus.plexus.archiver.Archiver; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.jar.JarArchiver; import org.codehaus.plexus.archiver.jar.ManifestException; @@ -69,26 +69,12 @@ public class SiteJarMojo extends SiteMojo { @Parameter(property = "project.build.finalName", required = true) private String finalName; - /** - * Used for attaching the artifact in the project. - */ - @Component - private MavenProjectHelper projectHelper; - /** * Specifies whether to attach the generated artifact to the project. */ @Parameter(property = "site.attach", defaultValue = "true") private boolean attach; - /** - * The Jar archiver. - * - * @since 3.1 - */ - @Component(role = Archiver.class, hint = "jar") - private JarArchiver jarArchiver; - /** * The archive configuration to use. * See Maven Archiver Reference. @@ -116,9 +102,28 @@ public class SiteJarMojo extends SiteMojo { @Parameter private String[] archiveExcludes; + /** + * Used for attaching the artifact in the project. + */ + private MavenProjectHelper projectHelper; + + /** + * The Jar archiver. + * + * @since 3.1 + */ + private JarArchiver jarArchiver; + + @Inject + public SiteJarMojo(MavenProjectHelper projectHelper, JarArchiver jarArchiver) { + this.projectHelper = projectHelper; + this.jarArchiver = jarArchiver; + } + /** * @see org.apache.maven.plugin.Mojo#execute() */ + @Override public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("maven.site.skip = true: Skipping jar generation");