use of com.synopsys.integration.detect.lifecycle.shutdown.ExitCodeRequest in project synopsys-detect by blackducksoftware.
the class PublishSignatureScanReports method publishReports.
public void publishReports(List<SignatureScannerReport> signatureScannerReports) {
signatureScannerReports.forEach(this::publishReport);
signatureScannerReports.stream().filter(SignatureScannerReport::isFailure).findAny().ifPresent(report -> {
logger.error(String.format("The Signature Scanner reported an error%s. The Signature Scanner log may contain relevant information.", report.getExitCode().map(code -> " (" + code + ")").orElse(".")));
exitCodePublisher.publishExitCode(new ExitCodeRequest(ExitCodeType.FAILURE_SCAN));
});
if (!treatSkippedScanAsSuccess) {
signatureScannerReports.stream().filter(SignatureScannerReport::isSkipped).findAny().ifPresent(report -> {
logger.error("The Signature Scanner skipped a scan because the minimum scan interval was not met.");
exitCodePublisher.publishExitCode(new ExitCodeRequest(ExitCodeType.FAILURE_MINIMUM_INTERVAL_NOT_MET));
});
}
}
Aggregations