This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch guice
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git

commit f8b886fb30d90720b3e89ddc22ef201939b682aa
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Tue Nov 19 09:20:01 2024 -0500

    Prefer Guice to Plexus
---
 .../site/descriptor/SiteDescriptorAttachMojo.java  | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
 
b/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
index 9459567b..5d39c0c2 100644
--- 
a/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
@@ -18,12 +18,13 @@
  */
 package org.apache.maven.plugins.site.descriptor;
 
+import javax.inject.Inject;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.Locale;
 
 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;
@@ -50,21 +51,26 @@ public class SiteDescriptorAttachMojo extends 
AbstractSiteDescriptorMojo {
     @Parameter(property = "basedir", required = true, readonly = true)
     private File basedir;
 
+    /**
+     * Attach site descriptor only if packaging is pom.
+     * @since 3.0
+     */
+    @Parameter(defaultValue = "true")
+    private boolean pomPackagingOnly;
+
     /**
      * Maven ProjectHelper.
      *
      * @since 2.1.1
      */
-    @Component
     private MavenProjectHelper projectHelper;
 
-    /**
-     * Attach site descriptor only if packaging is pom.
-     * @since 3.0
-     */
-    @Parameter(defaultValue = "true")
-    private boolean pomPackagingOnly;
+    @Inject
+    public SiteDescriptorAttachMojo(MavenProjectHelper projectHelper) {
+        this.projectHelper = projectHelper;
+    }
 
+    @Override
     public void execute() throws MojoExecutionException {
         if (pomPackagingOnly && !"pom".equals(project.getPackaging())) {
             // https://issues.apache.org/jira/browse/MSITE-597

Reply via email to