Class GetMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.GetMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="get",
requiresProject=false,
threadSafe=true)
public class GetMojo
extends org.apache.maven.plugin.AbstractMojo
Resolves a single artifact, eventually transitively, from the specified remote repositories. Caveat: will always
check the central repository defined in the super pom. You could use a mirror entry in your
settings.xml-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Patternprivate StringA string of the form groupId:artifactId:version[:packaging[:classifier]].private org.apache.maven.artifact.handler.manager.ArtifactHandlerManagerprivate StringThe artifactId of the artifact to download.private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverprivate StringThe classifier of the artifact to download.private org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinateprivate org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverprivate StringThe groupId of the artifact to download.private StringThe packaging of the artifact to download.private List<org.apache.maven.artifact.repository.ArtifactRepository>private StringRepositories in the format id::[layout]::url or just url, separated by comma.Map that contains the layouts.private org.apache.maven.repository.RepositorySystemThe repository system.private org.apache.maven.execution.MavenSessionprivate booleanSkip plugin execution completely.private booleanDownload transitively, retrieving the specified artifact and all of its dependencies.private StringThe version of the artifact to download.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()private org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayoutprotected booleanisSkip()(package private) org.apache.maven.artifact.repository.ArtifactRepositoryparseRepository(String repo, org.apache.maven.artifact.repository.ArtifactRepositoryPolicy policy) voidsetArtifactId(String artifactId) voidsetClassifier(String classifier) voidsetGroupId(String groupId) voidsetPackaging(String type) voidsetVersion(String version) private org.apache.maven.shared.transfer.artifact.ArtifactCoordinatetoArtifactCoordinate(org.apache.maven.shared.transfer.dependencies.DependableCoordinate dependableCoordinate) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
ALT_REPO_SYNTAX_PATTERN
-
session
@Parameter(defaultValue="${session}", required=true, readonly=true) private org.apache.maven.execution.MavenSession session -
artifactResolver
@Component private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver artifactResolver -
dependencyResolver
@Component private org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver dependencyResolver -
artifactHandlerManager
@Component private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager -
repositoryLayouts
@Component(role=org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout.class) private Map<String,org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout> repositoryLayoutsMap that contains the layouts. -
repositorySystem
@Component private org.apache.maven.repository.RepositorySystem repositorySystemThe repository system. -
coordinate
private org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate coordinate -
groupId
The groupId of the artifact to download. Ignored ifartifactis used. -
artifactId
The artifactId of the artifact to download. Ignored ifartifactis used. -
version
The version of the artifact to download. Ignored ifartifactis used. -
classifier
The classifier of the artifact to download. Ignored ifartifactis used.- Since:
- 2.3
-
packaging
The packaging of the artifact to download. Ignored ifartifactis used. -
remoteRepositories
Repositories in the format id::[layout]::url or just url, separated by comma. ie. central::default::https://repo.maven.apache.org/maven2,myrepo::::https://repo.acme.com,https://repo.acme2.com -
artifact
A string of the form groupId:artifactId:version[:packaging[:classifier]]. -
pomRemoteRepositories
@Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true, required=true) private List<org.apache.maven.artifact.repository.ArtifactRepository> pomRemoteRepositories -
transitive
@Parameter(property="transitive", defaultValue="true") private boolean transitiveDownload transitively, retrieving the specified artifact and all of its dependencies. -
skip
@Parameter(property="mdep.skip", defaultValue="false") private boolean skipSkip plugin execution completely.- Since:
- 2.7
-
-
Constructor Details
-
GetMojo
public GetMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
parseRepository
org.apache.maven.artifact.repository.ArtifactRepository parseRepository(String repo, org.apache.maven.artifact.repository.ArtifactRepositoryPolicy policy) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
getLayout
private org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout getLayout(String id) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
isSkip
protected boolean isSkip()- Returns:
skip
-
setGroupId
- Parameters:
groupId- The groupId.
-
setArtifactId
- Parameters:
artifactId- The artifactId.
-
setVersion
- Parameters:
version- The version.
-
setClassifier
- Parameters:
classifier- The classifier to be used.
-
setPackaging
- Parameters:
type- packaging.
-