diff --git a/plugin/src/main/java/org/wildfly/plugin/cli/ExecuteCommandsMojo.java b/plugin/src/main/java/org/wildfly/plugin/cli/ExecuteCommandsMojo.java index 6fe5d967..4a5c5f98 100644 --- a/plugin/src/main/java/org/wildfly/plugin/cli/ExecuteCommandsMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/cli/ExecuteCommandsMojo.java @@ -23,7 +23,6 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log; -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.project.MavenProject; @@ -181,7 +180,7 @@ public class ExecuteCommandsMojo extends AbstractServerConnection { @Parameter(alias = "auto-reload", defaultValue = "true", property = PropertyNames.AUTO_RELOAD) private boolean autoReload; - @Component + @Inject RepositorySystem repoSystem; @Parameter(defaultValue = "${repositorySystemSession}", readonly = true, required = true) diff --git a/plugin/src/main/java/org/wildfly/plugin/deployment/DeployArtifactMojo.java b/plugin/src/main/java/org/wildfly/plugin/deployment/DeployArtifactMojo.java index ddf51470..f00f2896 100644 --- a/plugin/src/main/java/org/wildfly/plugin/deployment/DeployArtifactMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/deployment/DeployArtifactMojo.java @@ -68,7 +68,7 @@ public void validate(final boolean isDomain) throws MojoDeploymentException { if (groupId == null) { throw new MojoDeploymentException("deploy-artifact must specify the groupId"); } - final Set dependencies = project.getDependencyArtifacts(); + final Set dependencies = project.getArtifacts(); Artifact artifact = null; for (final Artifact a : dependencies) { if (Objects.equals(a.getArtifactId(), artifactId) && diff --git a/plugin/src/main/java/org/wildfly/plugin/deployment/UndeployArtifactMojo.java b/plugin/src/main/java/org/wildfly/plugin/deployment/UndeployArtifactMojo.java index dcb24236..bd269bd8 100644 --- a/plugin/src/main/java/org/wildfly/plugin/deployment/UndeployArtifactMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/deployment/UndeployArtifactMojo.java @@ -96,7 +96,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { } final String deploymentName; if (name == null) { - final Set dependencies = project.getDependencyArtifacts(); + final Set dependencies = project.getArtifacts(); Artifact artifact = null; for (final Artifact a : dependencies) { if (Objects.equals(a.getArtifactId(), artifactId) && diff --git a/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java b/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java index 9e4d971b..f56cd147 100644 --- a/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java @@ -51,7 +51,6 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.descriptor.MojoDescriptor; -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; @@ -223,7 +222,7 @@ public class DevMojo extends AbstractServerStartMojo { Map.entry("workDirectory", "")); private final Map watchedDirectories = new HashMap<>(); - @Component + @Inject private BuildPluginManager pluginManager; @Inject diff --git a/plugin/src/main/java/org/wildfly/plugin/provision/AbstractProvisionServerMojo.java b/plugin/src/main/java/org/wildfly/plugin/provision/AbstractProvisionServerMojo.java index fbc02041..729f26dd 100644 --- a/plugin/src/main/java/org/wildfly/plugin/provision/AbstractProvisionServerMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/provision/AbstractProvisionServerMojo.java @@ -17,13 +17,13 @@ import java.util.List; import java.util.Map; +import javax.inject.Inject; import javax.xml.stream.XMLStreamException; 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.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; @@ -62,10 +62,10 @@ abstract class AbstractProvisionServerMojo extends AbstractMojo { } } - @Component + @Inject RepositorySystem repoSystem; - @Component + @Inject MavenProjectHelper projectHelper; @Parameter(defaultValue = "${repositorySystemSession}", readonly = true) diff --git a/plugin/src/main/java/org/wildfly/plugin/server/AbstractStartMojo.java b/plugin/src/main/java/org/wildfly/plugin/server/AbstractStartMojo.java index d853086c..2ae654cb 100644 --- a/plugin/src/main/java/org/wildfly/plugin/server/AbstractStartMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/server/AbstractStartMojo.java @@ -12,11 +12,12 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import javax.inject.Inject; + import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.eclipse.aether.RepositorySystem; @@ -40,7 +41,7 @@ */ public abstract class AbstractStartMojo extends AbstractServerConnection { - @Component + @Inject protected RepositorySystem repoSystem; @Parameter(defaultValue = "${repositorySystemSession}", readonly = true, required = true) diff --git a/tests/standalone-tests/src/test/java/org/wildfly/plugin/deployment/ArtifactDeploymentTest.java b/tests/standalone-tests/src/test/java/org/wildfly/plugin/deployment/ArtifactDeploymentTest.java index f7689f3c..b5e80312 100644 --- a/tests/standalone-tests/src/test/java/org/wildfly/plugin/deployment/ArtifactDeploymentTest.java +++ b/tests/standalone-tests/src/test/java/org/wildfly/plugin/deployment/ArtifactDeploymentTest.java @@ -72,7 +72,7 @@ private void testDeploy(final DeployArtifactMojo mojo, final String classifier) if (deploymentManager.hasDeployment(artifactName)) { deploymentManager.undeploy(UndeployDescription.of(artifactName)); } - mojo.project.setDependencyArtifacts(Collections.singleton(createArtifact(classifier))); + mojo.project.setArtifacts(Collections.singleton(createArtifact(classifier))); mojo.execute(); @@ -91,7 +91,7 @@ private void testUndeploy(final UndeployArtifactMojo mojo, final String classifi if (!deploymentManager.hasDeployment(artifactName)) { deploymentManager.deploy(Deployment.of(Paths.get(BASE_CONFIG_DIR, artifactName))); } - mojo.project.setDependencyArtifacts(Collections.singleton(createArtifact(classifier))); + mojo.project.setArtifacts(Collections.singleton(createArtifact(classifier))); mojo.execute();