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

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

commit c5e9728d830dd59f09341fe366947bceba72cdc3
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Tue Nov 19 07:59:56 2024 -0500

    [MDEP-966] Migrate TreeMojo from Plexus to Sisu Guice
---
 pom.xml                                            |  7 ------
 .../maven/plugins/dependency/tree/TreeMojo.java    | 26 +++++++++++++++-------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5ed9255b..74b7b060 100644
--- a/pom.xml
+++ b/pom.xml
@@ -146,13 +146,6 @@ under the License.
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.eclipse.sisu</groupId>
-      <artifactId>org.eclipse.sisu.plexus</artifactId>
-      <version>0.9.0.M3</version>
-      <scope>provided</scope>
-    </dependency>
-
     <!-- doxia -->
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
diff --git 
a/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java 
b/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java
index 59c05448..7a9e0e72 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java
@@ -18,6 +18,8 @@
  */
 package org.apache.maven.plugins.dependency.tree;
 
+import javax.inject.Inject;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.StringWriter;
@@ -32,7 +34,6 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
 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.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
@@ -75,27 +76,23 @@ public class TreeMojo extends AbstractMojo {
     /**
      * The Maven project.
      */
-    @Component
     private MavenProject project;
 
-    @Component
     private MavenSession session;
 
-    @Parameter(property = "outputEncoding", defaultValue = 
"${project.reporting.outputEncoding}")
-    private String outputEncoding;
-
     /**
      * The dependency collector builder to use.
      */
-    @Component(hint = "default")
     private DependencyCollectorBuilder dependencyCollectorBuilder;
 
     /**
      * The dependency graph builder to use.
      */
-    @Component(hint = "default")
     private DependencyGraphBuilder dependencyGraphBuilder;
 
+    @Parameter(property = "outputEncoding", defaultValue = 
"${project.reporting.outputEncoding}")
+    private String outputEncoding;
+
     /**
      * If specified, this parameter will cause the dependency tree to be 
written to the path specified, instead of
      * writing to the console.
@@ -205,6 +202,19 @@ public class TreeMojo extends AbstractMojo {
      */
     @Parameter(property = "skip", defaultValue = "false")
     private boolean skip;
+
+    @Inject
+    public TreeMojo(
+            MavenProject project,
+            MavenSession session,
+            DependencyCollectorBuilder dependencyCollectorBuilder,
+            DependencyGraphBuilder dependencyGraphBuilder) {
+        this.project = project;
+        this.session = session;
+        this.dependencyCollectorBuilder = dependencyCollectorBuilder;
+        this.dependencyGraphBuilder = dependencyGraphBuilder;
+    }
+
     // Mojo methods -----------------------------------------------------------
 
     /*

Reply via email to