in src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractDistTask.java [90:120]
private void validateArtifactGav( final Artifact artifact )
{
final Pom artifactPom = artifact.getPom();
if ( artifactPom != null )
{
final String gid;
final String aid;
final String version;
if ( artifactPom.getFile() != null )
{
final Model model = artifactPom.getModel( this );
gid = model.getGroupId();
aid = model.getArtifactId();
version = model.getVersion();
}
else
{
gid = artifactPom.getGroupId();
aid = artifactPom.getArtifactId();
version = artifactPom.getVersion();
}
final Model model = getPom().getModel( this );
if ( ! ( model.getGroupId().equals( gid ) && model.getArtifactId().equals( aid ) && model.getVersion().equals( version ) ) )
{
throw new BuildException( "Artifact references different pom than it would be installed with: "
+ artifact.toString() );
}
}
}