|
19 | 19 | package org.apache.maven.plugins.site.render; |
20 | 20 |
|
21 | 21 | import javax.inject.Inject; |
22 | | -import javax.inject.Named; |
23 | 22 |
|
24 | 23 | import java.io.File; |
25 | 24 | import java.io.IOException; |
26 | 25 |
|
27 | 26 | import org.apache.maven.archiver.MavenArchiveConfiguration; |
28 | 27 | import org.apache.maven.archiver.MavenArchiver; |
29 | 28 | import org.apache.maven.artifact.DependencyResolutionRequiredException; |
| 29 | +import org.apache.maven.doxia.site.inheritance.SiteModelInheritanceAssembler; |
| 30 | +import org.apache.maven.doxia.siterenderer.SiteRenderer; |
30 | 31 | import org.apache.maven.plugin.MojoExecutionException; |
31 | 32 | import org.apache.maven.plugin.MojoFailureException; |
32 | 33 | import org.apache.maven.plugins.annotations.LifecyclePhase; |
33 | 34 | import org.apache.maven.plugins.annotations.Mojo; |
34 | 35 | import org.apache.maven.plugins.annotations.Parameter; |
35 | 36 | import org.apache.maven.plugins.annotations.ResolutionScope; |
36 | 37 | import org.apache.maven.project.MavenProjectHelper; |
| 38 | +import org.apache.maven.reporting.exec.MavenReportExecutor; |
37 | 39 | import org.codehaus.plexus.archiver.ArchiverException; |
38 | 40 | import org.codehaus.plexus.archiver.jar.JarArchiver; |
39 | 41 | import org.codehaus.plexus.archiver.jar.ManifestException; |
@@ -70,27 +72,12 @@ public class SiteJarMojo extends SiteMojo { |
70 | 72 | @Parameter(property = "project.build.finalName", required = true) |
71 | 73 | private String finalName; |
72 | 74 |
|
73 | | - /** |
74 | | - * Used for attaching the artifact in the project. |
75 | | - */ |
76 | | - @Inject |
77 | | - private MavenProjectHelper projectHelper; |
78 | | - |
79 | 75 | /** |
80 | 76 | * Specifies whether to attach the generated artifact to the project. |
81 | 77 | */ |
82 | 78 | @Parameter(property = "site.attach", defaultValue = "true") |
83 | 79 | private boolean attach; |
84 | 80 |
|
85 | | - /** |
86 | | - * The Jar archiver. |
87 | | - * |
88 | | - * @since 3.1 |
89 | | - */ |
90 | | - @Inject |
91 | | - @Named("jar") |
92 | | - private JarArchiver jarArchiver; |
93 | | - |
94 | 81 | /** |
95 | 82 | * The archive configuration to use. |
96 | 83 | * See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven Archiver Reference</a>. |
@@ -118,6 +105,30 @@ public class SiteJarMojo extends SiteMojo { |
118 | 105 | @Parameter |
119 | 106 | private String[] archiveExcludes; |
120 | 107 |
|
| 108 | + /** |
| 109 | + * Used for attaching the artifact in the project. |
| 110 | + */ |
| 111 | + private final MavenProjectHelper projectHelper; |
| 112 | + |
| 113 | + /** |
| 114 | + * The Jar archiver. |
| 115 | + * |
| 116 | + * @since 3.1 |
| 117 | + */ |
| 118 | + private final JarArchiver jarArchiver; |
| 119 | + |
| 120 | + @Inject |
| 121 | + public SiteJarMojo( |
| 122 | + SiteModelInheritanceAssembler assembler, |
| 123 | + SiteRenderer siteRenderer, |
| 124 | + MavenReportExecutor mavenReportExecutor, |
| 125 | + MavenProjectHelper projectHelper, |
| 126 | + JarArchiver jarArchiver) { |
| 127 | + super(assembler, siteRenderer, mavenReportExecutor); |
| 128 | + this.projectHelper = projectHelper; |
| 129 | + this.jarArchiver = jarArchiver; |
| 130 | + } |
| 131 | + |
121 | 132 | /** |
122 | 133 | * @see org.apache.maven.plugin.Mojo#execute() |
123 | 134 | */ |
|
0 commit comments