in src/main/java/org/apache/maven/plugins/ear/util/ArtifactRepository.java [72:99]
public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier )
{
final Set<Artifact> candidates = getArtifacts( groupId, artifactId, type );
if ( candidates.size() == 0 )
{
return null;
}
else if ( candidates.size() == 1 && classifier == null )
{
return candidates.iterator().next();
}
else if ( classifier != null )
{
for ( Artifact a : candidates )
{
if ( a.getClassifier() == null && classifier.equals( mainArtifactId ) )
{
return a;
}
else if ( classifier.equals( a.getClassifier() ) )
{
return a;
}
}
}
// All other cases, classifier is null and more than one candidate ; artifact not found
return null;
}