o Improved error reporting

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@825944 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-10-16 15:33:34 +00:00
parent d6ad00a1f3
commit 0514606a44

View File

@ -310,7 +310,7 @@ private Model readModel( ModelSource modelSource, File pomFile, ModelBuildingReq
}
catch ( ModelParseException e )
{
if ( !strict || pomFile != null )
if ( !strict )
{
throw e;
}
@ -319,7 +319,14 @@ private Model readModel( ModelSource modelSource, File pomFile, ModelBuildingReq
model = modelProcessor.read( modelSource.getInputStream(), options );
problems.addWarning( "Malformed POM " + modelSource.getLocation() + ": " + e.getMessage(), e );
if ( pomFile != null )
{
problems.addError( "Malformed POM " + modelSource.getLocation() + ": " + e.getMessage(), e );
}
else
{
problems.addWarning( "Malformed POM " + modelSource.getLocation() + ": " + e.getMessage(), e );
}
}
}
catch ( ModelParseException e )