Class ArtifactInstaller
- java.lang.Object
-
- org.codehaus.cargo.maven2.configuration.ArtifactInstaller
-
public class ArtifactInstaller extends Object
An ArtifactInstaller encapsulates the resolving of an artifact from a local or remote Maven repository.
-
-
Constructor Summary
Constructors Constructor Description ArtifactInstaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getArtifactId()
String
getClassifier()
String
getExtractDir()
String
getGroupId()
String
getType()
String
getVersion()
File
resolve(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory, org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver, org.apache.maven.artifact.repository.ArtifactRepository localRepository, List<org.apache.maven.artifact.repository.ArtifactRepository> repositories)
Resolves the dependency and return the artifact file.void
setArtifactId(String artifactId)
void
setClassifier(String classifier)
void
setExtractDir(String extractDir)
void
setGroupId(String groupId)
void
setType(String type)
void
setVersion(String version)
-
-
-
Method Detail
-
getGroupId
public String getGroupId()
- Returns:
- Group id.
-
setGroupId
public void setGroupId(String groupId)
- Parameters:
groupId
- Group id.
-
getArtifactId
public String getArtifactId()
- Returns:
- Artifact id.
-
setArtifactId
public void setArtifactId(String artifactId)
- Parameters:
artifactId
- Artifact id.
-
getVersion
public String getVersion()
- Returns:
- Version.
-
setVersion
public void setVersion(String version)
- Parameters:
version
- Version.
-
getType
public String getType()
- Returns:
- Artifact type.
-
setType
public void setType(String type)
- Parameters:
type
- Artifact type.
-
getClassifier
public String getClassifier()
- Returns:
- Classifier.
-
setClassifier
public void setClassifier(String classifier)
- Parameters:
classifier
- Classifier.
-
getExtractDir
public String getExtractDir()
- Returns:
- the destination directory where the zipped container install will be installed.
-
setExtractDir
public void setExtractDir(String extractDir)
- Parameters:
extractDir
- the destination directory where the zipped container install will be installed.
-
resolve
public File resolve(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory, org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver, org.apache.maven.artifact.repository.ArtifactRepository localRepository, List<org.apache.maven.artifact.repository.ArtifactRepository> repositories) throws org.apache.maven.artifact.resolver.ArtifactResolutionException, org.apache.maven.artifact.resolver.ArtifactNotFoundException
Resolves the dependency and return the artifact file.- Parameters:
artifactFactory
- The artifact factory is used to create valid MavenArtifact
objects.artifactResolver
- The artifact resolver is used to dynamically resolveArtifact
objects. It will automatically download whatever needed.localRepository
- The local Maven repository. This is used by the artifact resolver to download resolved artifacts and put them in the local repository so that they won't have to be fetched again next time the plugin is executed.repositories
- The remote Maven repositories used by the artifact resolver to look for artifacts.- Returns:
- Resolved dependency.
- Throws:
org.apache.maven.artifact.resolver.ArtifactResolutionException
- If artifact resolution fails.org.apache.maven.artifact.resolver.ArtifactNotFoundException
- If artifact not found.
-
-