if ( groupId == null || artifactId == null )
{
throw new MojoFailureException(
"Could not resolve artifact[" + groupId + ":" + artifactId + ":" + getType() + "]" );
}
final ArtifactRepository ar = earExecutionContext.getArtifactRepository();
artifact = ar.getUniqueArtifact( groupId, artifactId, getType(), classifier );
// Artifact has not been found
if ( artifact == null )
{
@SuppressWarnings( "unchecked" )
Set<Artifact> candidates = ar.getArtifacts( groupId, artifactId, getType() );
if ( candidates.size() > 1 )
{
throw new MojoFailureException( "Artifact[" + this + "] has " + candidates.size()
+ " candidates, please provide a classifier." );
}