Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usages of deprecated code where applicable. #627

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading