org.apache.maven.plugin.ear.util
Class ArtifactRepository

java.lang.Object
  extended by org.apache.maven.plugin.ear.util.ArtifactRepository

public class ArtifactRepository
extends Object

An artifact repository used to resolve EarModule.

Version:
$Id: ArtifactRepository.java 1228846 2012-01-08 13:53:34Z rfscholte $
Author:
Stephane Nicoll

Constructor Summary
ArtifactRepository(Set<Artifact> artifacts, String mainArtifactId, ArtifactTypeMappingService artifactTypeMappingService)
          Creates a new repository wih the specified artifacts.
 
Method Summary
 Set<Artifact> getArtifacts(String groupId, String artifactId, String type)
          Returns the artifacts with the specified parameters.
 Artifact getUniqueArtifact(String groupId, String artifactId, String type)
          Returns the artifact with the specified parameters.
 Artifact getUniqueArtifact(String groupId, String artifactId, String type, String classifier)
          Returns the artifact with the specified parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactRepository

public ArtifactRepository(Set<Artifact> artifacts,
                          String mainArtifactId,
                          ArtifactTypeMappingService artifactTypeMappingService)
Creates a new repository wih the specified artifacts.

Parameters:
artifacts - the artifacts
mainArtifactId - the id to use for the main artifact (no classifier)
artifactTypeMappingService -
Method Detail

getUniqueArtifact

public 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 id
artifactId - the artifact id
type - the type
classifier - the classifier
Returns:
the artifact or null if no artifact were found

getUniqueArtifact

public 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 id
artifactId - the artifact id
type - the type
Returns:
the artifact or null if no artifact were found

getArtifacts

public Set<Artifact> getArtifacts(String groupId,
                                  String artifactId,
                                  String type)
Returns the artifacts with the specified parameters.

Parameters:
groupId - the group id
artifactId - the artifact id
type - the type
Returns:
the artifacts or an empty set if no artifact were found


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.