BuildSummary buildSummary = result.getBuildSummary( project );
private void logCompleted(MavenProject project) { BuildSummary buildSummary = rootSession.getResult().getBuildSummary(project); String message = "SKIPPED"; if (buildSummary instanceof BuildSuccess) { message = "SUCCESS"; } else if (buildSummary instanceof BuildFailure) { message = "FAILURE"; } else if (buildSummary != null) { logger.warn("Unexpected project build summary class {}", buildSummary.getClass()); message = "UNKNOWN"; } logger.info("{} build of project {}", message, projectGA(project)); }
public static ArrayList<MavenProjectDTO> extractFrom( final MavenExecutionResult event ) { ArrayList<MavenProjectDTO> participatingProjects = new ArrayList<MavenProjectDTO>(); List<MavenProject> projects = event.getTopologicallySortedProjects(); for ( MavenProject mavenProject : projects ) { MavenProjectDTO projectDTO = convertMavenProject( mavenProject ); updateWithBuildSummary( projectDTO, event.getBuildSummary( mavenProject ) ); participatingProjects.add( projectDTO ); } return participatingProjects; }
public static ArrayList<MavenProjectDTO> extractFrom( final MavenExecutionResult event ) { ArrayList<MavenProjectDTO> participatingProjects = new ArrayList<MavenProjectDTO>(); List<MavenProject> projects = event.getTopologicallySortedProjects(); for ( MavenProject mavenProject : projects ) { MavenProjectDTO projectDTO = convertMavenProject( mavenProject ); updateWithBuildSummary( projectDTO, event.getBuildSummary( mavenProject ) ); participatingProjects.add( projectDTO ); } return participatingProjects; }
public static ArrayList<MavenProjectDTO> extractFrom( final MavenExecutionResult event ) { ArrayList<MavenProjectDTO> participatingProjects = new ArrayList<MavenProjectDTO>(); List<MavenProject> projects = event.getTopologicallySortedProjects(); for ( MavenProject mavenProject : projects ) { MavenProjectDTO projectDTO = convertMavenProject( mavenProject ); updateWithBuildSummary( projectDTO, event.getBuildSummary( mavenProject ) ); participatingProjects.add( projectDTO ); } return participatingProjects; }
private String buildFullDescription(MavenExecutionResult result) { StringBuilder builder = new StringBuilder(); for (MavenProject project : result.getTopologicallySortedProjects()) { BuildSummary buildSummary = result.getBuildSummary(project); Status status = Status.of(buildSummary); builder.append(project.getName()); builder.append(": "); builder.append(status.message()); if (status != Status.SKIPPED) { builder.append(" ["); builder.append(TimeUnit.MILLISECONDS.toSeconds(buildSummary.getTime())); builder.append("s] "); } builder.append(LINE_BREAK); } return builder.toString(); }
BuildSummary buildSummary = result.getBuildSummary( project );
BuildSummary buildSummary = result.getBuildSummary( project );
BuildSummary buildSummary = result.getBuildSummary( project );
BuildSummary buildSummary = result.getBuildSummary( project );
public HudsonMavenExecutionResult(MavenExecutionResult mavenExecutionResult) { if (mavenExecutionResult == null) { return; } throwables = mavenExecutionResult.getExceptions(); List<MavenProject> mavenProjects = mavenExecutionResult.getTopologicallySortedProjects(); if (mavenProjects != null) { for (MavenProject mavenProject : mavenProjects) { MavenProjectInfo mavenProjectInfo = new MavenProjectInfo( mavenProject ); mavenProjectInfos.add( mavenProjectInfo ); BuildSummary buildSummary = mavenExecutionResult.getBuildSummary( mavenProject ); // NPE free : looks to have null here when the projects is not finished ie tests failures if ( buildSummary != null ) { mavenProjectInfo.setBuildTime( buildSummary.getTime() ); } } } }
public HudsonMavenExecutionResult(MavenExecutionResult mavenExecutionResult) { if (mavenExecutionResult == null) { return; } throwables = mavenExecutionResult.getExceptions(); List<MavenProject> mavenProjects = mavenExecutionResult.getTopologicallySortedProjects(); if (mavenProjects != null) { for (MavenProject mavenProject : mavenProjects) { MavenProjectInfo mavenProjectInfo = new MavenProjectInfo( mavenProject ); mavenProjectInfos.add( mavenProjectInfo ); BuildSummary buildSummary = mavenExecutionResult.getBuildSummary( mavenProject ); // NPE free : looks to have null here when the projects is not finished ie tests failures if ( buildSummary != null ) { mavenProjectInfo.setBuildTime( buildSummary.getTime() ); } } } }
@Override protected boolean _handle(MavenExecutionResult result) { Xpp3Dom root = new Xpp3Dom("MavenExecutionResult"); root.setAttribute("class", result.getClass().getName()); for (MavenProject project : result.getTopologicallySortedProjects()) { BuildSummary summary = result.getBuildSummary(project); if (summary == null) { Xpp3Dom comment = new Xpp3Dom("comment"); comment.setValue("No build summary found for maven project: " + project); root.addChild(comment); } else { Xpp3Dom buildSummary = newElement("buildSummary", project); root.addChild(buildSummary); buildSummary.setAttribute("class", summary.getClass().getName()); buildSummary.setAttribute("time", Long.toString(summary.getTime())); } } reporter.print(root); return true; } }
boolean done = true; for (MavenProject project : getMavenSession().getProjects()) { if (currentProject != project && getMavenSession().getResult().getBuildSummary(project) == null) { done = false; break;
private void recordProjectFinished( final ExecutionEvent event ) { Type type = event.getType(); if ( ProjectSucceeded.equals( type ) || ProjectFailed.equals( type ) || ProjectSkipped.equals( type ) ) { MavenProject project = event.getProject(); BuildSummary buildSummary = event.getSession().getResult().getBuildSummary( project ); log.debug( "Updating MavenProject" ); getBuildRecorder().recordProjectFinished(project, buildSummary); // Record artifact usage at end of project build since they are // populated in each phase, not at the beginning. // NOTE: Benjamin has indicated that this is very closely bound to // the plugin lifecycle and exposes only those artifacts, that a // plugin has asked for now. // Hence why there's no info at project finished. ProjectLogger.log( project, "project finished" ); } }
private void recordProjectFinished( final ExecutionEvent event ) { Type type = event.getType(); if ( ProjectSucceeded.equals( type ) || ProjectFailed.equals( type ) || ProjectSkipped.equals( type ) ) { MavenProject project = event.getProject(); BuildSummary buildSummary = event.getSession().getResult().getBuildSummary( project ); log.debug( "Updating MavenProject" ); getBuildRecorder().recordProjectFinished(project, buildSummary); // Record artifact usage at end of project build since they are // populated in each phase, not at the beginning. // NOTE: Benjamin has indicated that this is very closely bound to // the plugin lifecycle and exposes only those artifacts, that a // plugin has asked for now. // Hence why there's no info at project finished. ProjectLogger.log( project, "project finished" ); } }
private void recordProjectFinished( final ExecutionEvent event ) { Type type = event.getType(); if ( ProjectSucceeded.equals( type ) || ProjectFailed.equals( type ) || ProjectSkipped.equals( type ) ) { MavenProject project = event.getProject(); BuildSummary buildSummary = event.getSession().getResult().getBuildSummary( project ); log.debug( "Updating MavenProject" ); getBuildRecorder().recordProjectFinished(project, buildSummary); // Record artifact usage at end of project build since they are // populated in each phase, not at the beginning. // NOTE: Benjamin has indicated that this is very closely bound to // the plugin lifecycle and exposes only those artifacts, that a // plugin has asked for now. // Hence why there's no info at project finished. ProjectLogger.log( project, "project finished" ); } }