use of org.apache.maven.plugins.invoker.model.BuildJob in project maven-plugins by apache.
the class InvokerSession method updateStats.
private void updateStats() {
if (successfulJobs != null && skippedJobs != null && failedJobs != null && errorJobs != null) {
return;
}
successfulJobs = new ArrayList<BuildJob>();
failedJobs = new ArrayList<BuildJob>();
skippedJobs = new ArrayList<BuildJob>();
errorJobs = new ArrayList<BuildJob>();
for (BuildJob buildJob : buildJobs) {
if (BuildJob.Result.SUCCESS.equals(buildJob.getResult())) {
successfulJobs.add(buildJob);
} else if (BuildJob.Result.SKIPPED.equals(buildJob.getResult())) {
skippedJobs.add(buildJob);
} else if (BuildJob.Result.ERROR.equals(buildJob.getResult())) {
errorJobs.add(buildJob);
} else if (buildJob.getResult() != null) {
failedJobs.add(buildJob);
}
}
}
use of org.apache.maven.plugins.invoker.model.BuildJob in project maven-plugins by apache.
the class InvokerSession method logSummary.
/**
* Prints a summary of this session to the specified logger.
*
* @param logger The mojo logger to output messages to, must not be <code>null</code>.
* @param ignoreFailures A flag whether failures should be ignored or whether a build failure should be signaled.
*/
public void logSummary(Log logger, boolean ignoreFailures) {
updateStats();
String separator = buffer().strong("-------------------------------------------------").toString();
logger.info(separator);
logger.info("Build Summary:");
logger.info(" Passed: " + successfulJobs.size() + ", Failed: " + failedJobs.size() + ", Errors: " + errorJobs.size() + ", Skipped: " + skippedJobs.size());
logger.info(separator);
if (!failedJobs.isEmpty()) {
String heading = "The following builds failed:";
if (ignoreFailures) {
logger.warn(heading);
} else {
logger.error(heading);
}
for (BuildJob buildJob : failedJobs) {
String item = "* " + buildJob.getProject();
if (ignoreFailures) {
logger.warn(item);
} else {
logger.error(item);
}
}
logger.info(separator);
}
}
use of org.apache.maven.plugins.invoker.model.BuildJob in project maven-plugins by apache.
the class InvokerMojoTest method testSingleInvokerTest.
public void testSingleInvokerTest() throws Exception {
InvokerMojo invokerMojo = new InvokerMojo();
String dirPath = getBasedir() + "/src/test/resources/unit";
List<String> goals = invokerMojo.getGoals(new File(dirPath));
assertEquals(1, goals.size());
setVariableValueToObject(invokerMojo, "projectsDirectory", new File(dirPath));
setVariableValueToObject(invokerMojo, "invokerTest", "*dummy*");
BuildJob[] poms = invokerMojo.getBuildJobs();
assertEquals(1, poms.length);
}
Aggregations