Class ArtifactRepository
java.lang.Object
org.apache.maven.plugins.ear.util.ArtifactRepository
An artifact repository used to resolve
EarModule
.- Author:
- Stephane Nicoll
-
Constructor Summary
ConstructorsConstructorDescriptionArtifactRepository
(Set<org.apache.maven.artifact.Artifact> artifacts, String mainArtifactId, ArtifactTypeMappingService artifactTypeMappingService) Creates a new repository with the specified artifacts. -
Method Summary
Modifier and TypeMethodDescriptionSet
<org.apache.maven.artifact.Artifact> getArtifacts
(String groupId, String artifactId, String type) Returns the artifacts with the specified parameters.org.apache.maven.artifact.Artifact
getUniqueArtifact
(String groupId, String artifactId, String type) Returns the artifact with the specified parameters.org.apache.maven.artifact.Artifact
getUniqueArtifact
(String groupId, String artifactId, String type, String classifier) Returns the artifact with the specified parameters.
-
Constructor Details
-
ArtifactRepository
public ArtifactRepository(Set<org.apache.maven.artifact.Artifact> artifacts, String mainArtifactId, ArtifactTypeMappingService artifactTypeMappingService) Creates a new repository with the specified artifacts.- Parameters:
artifacts
- the artifactsmainArtifactId
- the id to use for the main artifact (no classifier)artifactTypeMappingService
-ArtifactTypeMappingService
-
-
Method Details
-
getUniqueArtifact
public org.apache.maven.artifact.Artifact getUniqueArtifact(String groupId, String artifactId, String type, String classifier) Returns the artifact with the specified parameters.If the artifact is classified and is the only one with the specified groupI, artifactId and type, it will be returned.
If the artifact is classified and is not the only one with the specified groupI, artifactId and type, it returns null.
If the artifact is not found, it returns null.- Parameters:
groupId
- the group idartifactId
- the artifact idtype
- the typeclassifier
- the classifier- Returns:
- the artifact or null if no artifact were found
-
getUniqueArtifact
public org.apache.maven.artifact.Artifact getUniqueArtifact(String groupId, String artifactId, String type) Returns the artifact with the specified parameters.If the artifact is classified and is the only one with the specified groupI, artifactId and type, it will be returned.
If the artifact is classified and is not the only one with the specified groupI, artifactId and type, it returns null.
If the artifact is not found, it returns null.- Parameters:
groupId
- the group idartifactId
- the artifact idtype
- the type- Returns:
- the artifact or null if no artifact were found
-
getArtifacts
public Set<org.apache.maven.artifact.Artifact> getArtifacts(String groupId, String artifactId, String type) Returns the artifacts with the specified parameters.- Parameters:
groupId
- the group idartifactId
- the artifact idtype
- the type- Returns:
- the artifacts or an empty set if no artifact were found
-