use of org.owasp.dependencycheck.exception.ExceptionCollection in project dependency-check-plugin by jenkinsci.
the class DependencyCheckExecutor method call.
/**
* Performs a DependencyCheck analysis build.
*
* @return a boolean value indicating if the build was successful or not. A
* successful build is not determined by the ability to analyze
* dependencies, rather, simply to determine if errors were encountered
* during the execution.
*/
public Boolean call() throws IOException {
if (getJavaVersion() <= 1.6) {
log(Messages.Failure_Java_Version());
return false;
}
log(Messages.Executor_Display_Options());
log(options.toString());
if (!prepareDirectories()) {
return false;
}
Engine engine = null;
try {
engine = executeDependencyCheck();
if (options.isUpdateOnly()) {
return true;
} else {
return generateExternalReports(engine);
}
} catch (DatabaseException ex) {
log(Messages.Failure_Database_Connect());
log(ex.getMessage());
} catch (UpdateException ex) {
log(Messages.Failure_Database_Update());
} catch (ExceptionCollection ec) {
log(Messages.Failure_Collection());
for (Throwable t : ec.getExceptions()) {
log("Exception Caught: " + t.getClass().getCanonicalName());
if (t.getCause() != null && t.getCause().getMessage() != null) {
log("Cause: " + t.getCause().getMessage());
}
log("Message: " + t.getMessage());
log(ExceptionUtils.getStackTrace(t));
}
} finally {
settings.cleanup(true);
if (engine != null) {
engine.close();
}
}
return false;
}
Aggregations