Skip to content

Commit

Permalink
Remove usages of deprecated code where applicable.
Browse files Browse the repository at this point in the history
Signed-off-by: James R. Perkins <jperkins@redhat.com>
  • Loading branch information
jamezp committed Dec 16, 2024
1 parent 5f1ee80 commit 9d7846a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Artifact> dependencies = project.getDependencyArtifacts();
final Set<Artifact> dependencies = project.getArtifacts();
Artifact artifact = null;
for (final Artifact a : dependencies) {
if (Objects.equals(a.getArtifactId(), artifactId) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}
final String deploymentName;
if (name == null) {
final Set<Artifact> dependencies = project.getDependencyArtifacts();
final Set<Artifact> dependencies = project.getArtifacts();
Artifact artifact = null;
for (final Artifact a : dependencies) {
if (Objects.equals(a.getArtifactId(), artifactId) &&
Expand Down
3 changes: 1 addition & 2 deletions plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -223,7 +222,7 @@ public class DevMojo extends AbstractServerStartMojo {
Map.entry("workDirectory", ""));
private final Map<WatchKey, WatchContext> watchedDirectories = new HashMap<>();

@Component
@Inject
private BuildPluginManager pluginManager;

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -62,10 +62,10 @@ abstract class AbstractProvisionServerMojo extends AbstractMojo {
}
}

@Component
@Inject
RepositorySystem repoSystem;

@Component
@Inject
MavenProjectHelper projectHelper;

@Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,7 +41,7 @@
*/
public abstract class AbstractStartMojo extends AbstractServerConnection {

@Component
@Inject
protected RepositorySystem repoSystem;

@Parameter(defaultValue = "${repositorySystemSession}", readonly = true, required = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();

Expand Down

0 comments on commit 9d7846a

Please sign in to comment.