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-antrun-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new d97356a  Switch from plexus to Guice (#106)
d97356a is described below

commit d97356a4a6f31ad5837d2d5e71d0de0e2e13a7db
Author: Elliotte Rusty Harold <elh...@users.noreply.github.com>
AuthorDate: Thu Nov 28 17:21:06 2024 +0000

    Switch from plexus to Guice (#106)
    
    * Switch from plexus to Guice
---
 pom.xml                                               | 11 +++++++++++
 .../org/apache/maven/plugins/antrun/AntRunMojo.java   | 19 ++++++++++++-------
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 38f12f2..b1febfe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,6 +108,17 @@ under the License.
       <artifactId>maven-plugin-annotations</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.plexus</artifactId>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
diff --git a/src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java 
b/src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java
index b376379..508ab1b 100644
--- a/src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java
+++ b/src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java
@@ -18,6 +18,8 @@
  */
 package org.apache.maven.plugins.antrun;
 
+import javax.inject.Inject;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.LineNumberReader;
@@ -36,7 +38,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;
@@ -123,12 +124,6 @@ public class AntRunMojo extends AbstractMojo {
     @Parameter(defaultValue = "${session}", readonly = true, required = true)
     private MavenSession session;
 
-    /**
-     * The Maven project helper object
-     */
-    @Component
-    private MavenProjectHelper projectHelper;
-
     /**
      * The plugin dependencies.
      */
@@ -246,6 +241,16 @@ public class AntRunMojo extends AbstractMojo {
     @Parameter(defaultValue = "true")
     private boolean failOnError;
 
+    /**
+     * The Maven project helper object
+     */
+    private MavenProjectHelper projectHelper;
+
+    @Inject
+    public AntRunMojo(MavenProjectHelper projectHelper) {
+        this.projectHelper = projectHelper;
+    }
+
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
         checkDeprecatedParameterUsage(tasks, "tasks", "target");

Reply via email to