Skip to content
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
5 changes: 5 additions & 0 deletions maven-resolver-demos/maven-resolver-demo-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
*/
package org.apache.maven.resolver.examples.maven;

import javax.inject.Inject;

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.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.eclipse.aether.RepositorySystem;
Expand All @@ -43,11 +44,6 @@
@Mojo(name = "resolve-artifact", threadSafe = true)
public class ResolveArtifactMojo extends AbstractMojo {
private static final Logger LOGGER = LoggerFactory.getLogger(ResolveArtifactMojo.class);
/**
* The entry point to Maven Artifact Resolver, i.e. the component doing all the work.
*/
@Component
private RepositorySystem repoSystem;

/**
* The current repository/network configuration of Maven.
Expand All @@ -67,6 +63,16 @@ public class ResolveArtifactMojo extends AbstractMojo {
@Parameter(property = "resolver.artifactCoords", readonly = true)
private String artifactCoords;

/**
* The entry point to Maven Artifact Resolver; that is, the component doing all the work.
*/
private final RepositorySystem repoSystem;

@Inject
public ResolveArtifactMojo(RepositorySystem repoSystem) {
this.repoSystem = repoSystem;
}

/**
* The actual execution of the mojo.
*/
Expand Down
Loading