mirror of https://github.com/apache/maven.git
PR: MNG-1162
better error handling for invalid pom reference git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312809 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b3bdc1a78f
commit
d3f5c3d755
|
@ -196,5 +196,11 @@
|
||||||
<pom refid="maven.project"/>
|
<pom refid="maven.project"/>
|
||||||
</artifact:deploy>
|
</artifact:deploy>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="test-invalid-pom-ref" depends="initTaskDefs">
|
||||||
|
<artifact:dependencies>
|
||||||
|
<pom refid="invalid-ref" />
|
||||||
|
</artifact:dependencies>
|
||||||
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,10 @@ public class Pom
|
||||||
if ( refid != null )
|
if ( refid != null )
|
||||||
{
|
{
|
||||||
instance = (Pom) getProject().getReference( refid );
|
instance = (Pom) getProject().getReference( refid );
|
||||||
|
if ( instance == null )
|
||||||
|
{
|
||||||
|
throw new BuildException( "Invalid reference: '" + refid + "'" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue