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

elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git


The following commit(s) were added to refs/heads/master by this push:
     new 62b264c  Change @Component to Guice @Inject (#60)
62b264c is described below

commit 62b264c98072815164b6a744343ac37050e5d6bf
Author: Elliotte Rusty Harold <elh...@users.noreply.github.com>
AuthorDate: Sun Dec 8 15:27:55 2024 +0000

    Change @Component to Guice @Inject (#60)
    
    * Remove @Component, rely on field injection  instead
---
 .../maven/reporting/AbstractMavenReport.java       | 29 +++++++++++-----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java 
b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
index 2001157..5fe89bf 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
@@ -18,6 +18,8 @@
  */
 package org.apache.maven.reporting;
 
+import javax.inject.Inject;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -47,7 +49,6 @@ import org.apache.maven.model.Reporting;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.utils.WriterFactory;
@@ -156,18 +157,6 @@ public abstract class AbstractMavenReport extends 
AbstractMojo implements MavenM
     @Parameter(defaultValue = "${project.build.outputTimestamp}")
     protected String outputTimestamp;
 
-    /**
-     * SiteTool.
-     */
-    @Component
-    protected SiteTool siteTool;
-
-    /**
-     * Doxia Site Renderer component.
-     */
-    @Component
-    protected Renderer siteRenderer;
-
     /** The current sink to use */
     private Sink sink;
 
@@ -183,9 +172,21 @@ public abstract class AbstractMavenReport extends 
AbstractMojo implements MavenM
     @Parameter(property = "output.format")
     protected String outputFormat;
 
-    @Component
+    @Inject
     private PlexusContainer container;
 
+    /**
+     * SiteTool.
+     */
+    @Inject
+    protected SiteTool siteTool;
+
+    /**
+     * Doxia Site Renderer component.
+     */
+    @Inject
+    protected Renderer siteRenderer;
+
     /**
      * This method is called when the report generation is invoked directly as 
a standalone Mojo.
      * This implementation is now marked {@code final} as it is not expected 
to be overridden:

Reply via email to