if ( project != null && !project.equals( result.getTopologicallySortedProjects().get( 0 ) ) ) + getResumeFrom( result.getTopologicallySortedProjects(), project ) ).toString() );
private boolean hasOnlyOneModule(MavenExecutionResult result) { return result.getTopologicallySortedProjects().size() == 1; }
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(); }
if ( project != null && !project.equals( result.getTopologicallySortedProjects().get( 0 ) ) )
if (project != null && !project.equals(result.getTopologicallySortedProjects().get(0))) { slf4jLogger.error(""); slf4jLogger.error("After correcting the problems, you can resume the build with the command");
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() ); } } } }
if (project != null && !project.equals(result.getTopologicallySortedProjects().get(0))) { reusableSlf4jLogger.error(""); reusableSlf4jLogger.error("After correcting the problems, you can resume the build with the command");
protected List<MavenProject> getSortedProjects(File basedir, File platform) throws Exception { File pom = new File(basedir, "pom.xml"); MavenExecutionRequest request = newMavenExecutionRequest(pom); request.getProjectBuildingRequest().setProcessPlugins(false); request.setLocalRepository(getLocalRepository()); if (platform != null) { request.getUserProperties().put("tycho.targetPlatform", platform.getCanonicalPath()); } MavenExecutionResult result = maven.execute( request ); if (result.hasExceptions()) { throw new CompoundRuntimeException(result.getExceptions()); } return result.getTopologicallySortedProjects(); }
protected List<MavenProject> getSortedProjects(File basedir, Properties userProperties, File platform) throws Exception { File pom = new File(basedir, "pom.xml"); MavenExecutionRequest request = newMavenExecutionRequest(pom); request.getProjectBuildingRequest().setProcessPlugins(false); request.setLocalRepository(getLocalRepository()); if (platform != null) { request.getUserProperties().put("tycho.targetPlatform", platform.getAbsolutePath()); } if (userProperties != null) { request.getUserProperties().putAll(userProperties); } MavenExecutionResult result = maven.execute(request); if (result.hasExceptions()) { throw new CompoundRuntimeException(result.getExceptions()); } return result.getTopologicallySortedProjects(); }
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; } }
if ( project != null && !project.equals( result.getTopologicallySortedProjects().get( 0 ) ) ) + getResumeFrom( result.getTopologicallySortedProjects(), project ) ).toString() );