From 3a4afbb6d84794c0635ef2f926f28e01b587c050 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Sun, 17 Nov 2024 13:07:27 -0500 Subject: [PATCH] @Component --> @Inject for DisplayAncestorsMojo --- .../plugins/dependency/DisplayAncestorsMojo.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java b/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java index 4a52c0150..06f7f5a1b 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java @@ -18,13 +18,14 @@ */ package org.apache.maven.plugins.dependency; +import javax.inject.Inject; + import java.util.ArrayList; import java.util.List; 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.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.project.MavenProject; @@ -39,12 +40,13 @@ @Mojo(name = "display-ancestors", threadSafe = true, requiresProject = true, defaultPhase = LifecyclePhase.VALIDATE) public class DisplayAncestorsMojo extends AbstractMojo { - /** - * POM - */ - @Component private MavenProject project; + @Inject + public DisplayAncestorsMojo(MavenProject project) { + this.project = project; + } + @Override public void execute() throws MojoExecutionException, MojoFailureException { final List ancestors = collectAncestors();