mirror of https://github.com/apache/maven.git
o Improved problem reporting
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@884840 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f957961cb8
commit
d6e0a1b149
|
@ -124,7 +124,7 @@ public class DefaultExceptionHandler
|
|||
|
||||
for ( ModelProblem problem : result.getProblems() )
|
||||
{
|
||||
ExceptionSummary child = handle( problem );
|
||||
ExceptionSummary child = handle( problem, result.getProjectId() );
|
||||
if ( child != null )
|
||||
{
|
||||
children.add( child );
|
||||
|
@ -143,11 +143,30 @@ public class DefaultExceptionHandler
|
|||
return new ExceptionSummary( null, message, null, children );
|
||||
}
|
||||
|
||||
private ExceptionSummary handle( ModelProblem problem )
|
||||
private ExceptionSummary handle( ModelProblem problem, String projectId )
|
||||
{
|
||||
if ( ModelProblem.Severity.ERROR.compareTo( problem.getSeverity() ) >= 0 )
|
||||
{
|
||||
return handle( problem.getMessage(), problem.getException() );
|
||||
String message = problem.getMessage();
|
||||
|
||||
String location = "";
|
||||
|
||||
if ( !problem.getModelId().equals( projectId ) )
|
||||
{
|
||||
location += problem.getModelId();
|
||||
|
||||
if ( StringUtils.isNotEmpty( problem.getSource() ) )
|
||||
{
|
||||
location += " (" + problem.getSource() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
if ( StringUtils.isNotEmpty( location ) )
|
||||
{
|
||||
message += " @ " + location;
|
||||
}
|
||||
|
||||
return handle( message, problem.getException() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue