Skip to content

Commit

Permalink
@component --> @Inject for DisplayAncestorsMojo
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Nov 17, 2024
1 parent c04f223 commit 3a4afbb
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String> ancestors = collectAncestors();
Expand Down

0 comments on commit 3a4afbb

Please sign in to comment.