StringBuilder buffer = new StringBuilder();
for ( Map.Entry<MavenProject, DocumentationReporter> entry : reporters.entrySet() )
{
MavenProject project = entry.getKey();
DocumentationReporter reporter = entry.getValue();
if ( !reporter.getMessages().isEmpty() )
{
buffer.append( "\no " ).append( project.getName() );
buffer.append( " (" );
final int numberOfErrors = reporter.getMessagesByType( DocumentationReport.TYPE_ERROR ).size();
buffer.append( numberOfErrors ).append( " error" ).append( numberOfErrors == 1 ? "" : "s" );
buffer.append( ", " );
final int numberOfWarnings = reporter.getMessagesByType( DocumentationReport.TYPE_WARN ).size();
buffer.append( numberOfWarnings ).append( " warning" ).append( numberOfWarnings == 1 ? "" : "s" );
buffer.append( ")" );
buffer.append( "\n" );
for ( String error : reporter.getMessages() )
{
buffer.append( " " ).append( error ).append( "\n" );
}
}
}