Skip to content

Commit

Permalink
maven-plugins: Replace usage of deprecated Component annotation
Browse files Browse the repository at this point in the history
We use the suggested replacement of @Inject.

Signed-off-by: BJ Hargrave <[email protected]>
  • Loading branch information
bjhargrave committed Aug 28, 2024
1 parent 71848bf commit b20d74d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.maven.plugin.MojoExecution;
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.Parameter;
import org.apache.maven.project.MavenProject;
import org.eclipse.transformer.AppOption;
Expand All @@ -32,6 +31,8 @@
import org.slf4j.LoggerFactory;
import org.sonatype.plexus.build.incremental.BuildContext;

import javax.inject.Inject;

/**
* Base Mojo class.
*/
Expand Down Expand Up @@ -72,7 +73,7 @@ public abstract class AbstractTransformerMojo extends AbstractMojo {
@Parameter(property = "transform.skip", defaultValue = "false")
private boolean skip;

@Component
@Inject
private BuildContext buildContext;

public boolean skip() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.apache.maven.model.DependencyManagement;
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.plugins.annotations.Parameter;
Expand All @@ -49,6 +48,8 @@
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.transformer.maven.configuration.TransformerArtifact;

import javax.inject.Inject;

/**
* Transforms a specified artifact into a new artifact.
* <p>
Expand Down Expand Up @@ -119,13 +120,13 @@ public class TransformerJarMojo extends AbstractTransformerMojo {
@Parameter
private TransformerArtifact artifact = new TransformerArtifact();

@Component
@Inject
private ArtifactResolver artifactResolver;

@Component
@Inject
private MavenProjectHelper projectHelper;

@Component
@Inject
private ArtifactHandlerManager artifactHandlerManager;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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.plugins.annotations.Parameter;
Expand All @@ -39,6 +38,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;

/**
* Transforms all the project's artifacts.
* <p>
Expand Down Expand Up @@ -89,7 +90,7 @@ public class TransformerRunMojo extends AbstractMojo {
@Parameter(defaultValue = "${project.build.directory}", required = true)
private File outputDirectory;

@Component
@Inject
private MavenProjectHelper projectHelper;

/**
Expand Down

0 comments on commit b20d74d

Please sign in to comment.