{
// if the project artifact doesn't exist, don't use it. We haven't built that far.
if ( ref.getArtifact().getFile() != null && ref.getArtifact().getFile().exists() )
{
// FIXME: Why aren't we using project.getArtifact() for the second parameter here??
Artifact resultArtifact = new ActiveProjectArtifact( ref, pluginArtifact );
return resultArtifact;
}
else
{
logMissingSiblingProjectArtifact( pluginArtifact );
}
}
Artifact attached = findMatchingArtifact( ref.getAttachedArtifacts(), pluginArtifact );
if ( attached != null )
{
if ( attached.getFile() != null && attached.getFile().exists() )
{
Artifact resultArtifact = ArtifactUtils.copyArtifact( attached );
resultArtifact.setScope( pluginArtifact.getScope() );
return resultArtifact;
}
else
{
logMissingSiblingProjectArtifact( pluginArtifact );