mirror of https://github.com/apache/maven.git
[MNG-6391] - Printout version of last built module in reactor build
This commit is contained in:
parent
42c77a71df
commit
23f5c88d11
|
@ -141,19 +141,46 @@ public class ExecutionEventLogger
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isSingleVersionedReactor( MavenSession session )
|
||||
{
|
||||
boolean result = true;
|
||||
|
||||
MavenProject topProject = session.getTopLevelProject();
|
||||
List<MavenProject> sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
|
||||
for ( MavenProject mavenProject : sortedProjects )
|
||||
{
|
||||
if ( !topProject.getVersion().equals( mavenProject.getVersion() ) )
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void logReactorSummary( MavenSession session )
|
||||
{
|
||||
boolean isSingleVersion = isSingleVersionedReactor( session );
|
||||
|
||||
infoLine( '-' );
|
||||
|
||||
infoMain( "Reactor Summary:" );
|
||||
StringBuilder summary = new StringBuilder( "Reactor Summary" );
|
||||
if ( isSingleVersion )
|
||||
{
|
||||
summary.append( " for " );
|
||||
summary.append( session.getTopLevelProject().getName() );
|
||||
summary.append( " " );
|
||||
summary.append( session.getTopLevelProject().getVersion() );
|
||||
}
|
||||
summary.append( ":" );
|
||||
infoMain( summary.toString() );
|
||||
|
||||
logger.info( "" );
|
||||
|
||||
MavenExecutionResult result = session.getResult();
|
||||
|
||||
List<MavenProject> projects = session.getProjects();
|
||||
MavenProject lastProject = projects.get( projects.size() - 1 );
|
||||
MavenProject topProject = session.getTopLevelProject();
|
||||
|
||||
for ( MavenProject project : projects )
|
||||
{
|
||||
|
@ -162,8 +189,7 @@ public class ExecutionEventLogger
|
|||
buffer.append( project.getName() );
|
||||
buffer.append( ' ' );
|
||||
|
||||
if ( topProject.equals( project ) || lastProject.equals( project )
|
||||
|| !topProject.getVersion().equals( project.getVersion() ) )
|
||||
if ( !isSingleVersion )
|
||||
{
|
||||
buffer.append( project.getVersion() );
|
||||
buffer.append( ' ' );
|
||||
|
@ -241,7 +267,7 @@ public class ExecutionEventLogger
|
|||
|
||||
String wallClock = session.getRequest().getDegreeOfConcurrency() > 1 ? " (Wall Clock)" : "";
|
||||
|
||||
logger.info( "Total time: " + formatDuration( time ) + wallClock );
|
||||
logger.info( "Total time: " + formatDuration( time ) + wallClock );
|
||||
|
||||
logger.info( "Finished at: " + formatTimestamp( finish ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue