private ExceptionSummary handle( ProjectBuildingResult result ) { List<ExceptionSummary> children = new ArrayList<>(); for ( ModelProblem problem : result.getProblems() ) { ExceptionSummary child = handle( problem, result.getProjectId() ); if ( child != null ) { children.add( child ); } } if ( children.isEmpty() ) { return null; } String message = "\nThe project " + result.getProjectId() + " (" + result.getPomFile() + ") has " + children.size() + " error" + ( children.size() == 1 ? "" : "s" ); return new ExceptionSummary( null, message, null, children ); }
private static String createMessage( List<ProjectBuildingResult> results ) { StringWriter buffer = new StringWriter( 1024 ); PrintWriter writer = new PrintWriter( buffer ); writer.println( "Some problems were encountered while processing the POMs:" ); try { for ( ProjectBuildingResult result : results ) { for ( ModelProblem problem : result.getProblems() ) { writer.print( "[" ); writer.print( problem.getSeverity() ); writer.print( "] " ); writer.print( problem.getMessage() ); writer.print( " @ " ); writer.println( ModelProblemUtils.formatLocation( problem, result.getProjectId() ) ); } } } finally { writer.close(); } return buffer.toString(); }
String loc = ModelProblemUtils.formatLocation( problem, result.getProjectId() ); logger.warn( problem.getMessage() + ( StringUtils.isNotEmpty( loc ) ? " @ " + loc : "" ) );
if ( problems != null && !problems.isEmpty() ) builder.append( "\n" ).append( result.getProjectId() ); for ( final ModelProblem problem : problems )