Search in sources :

Example 1 with VerificationReport

use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.report.VerificationReport in project gradle by gradle.

the class ChecksumAndSignatureVerificationOverride method artifactsAccessed.

@Override
public void artifactsAccessed(String displayName) {
    verifyConcurrently();
    synchronized (failures) {
        if (hasFatalFailure.get() && !failures.isEmpty()) {
            // There are fatal failures, but not necessarily on all artifacts so we first filter out
            // the artifacts which only have not fatal errors
            failures.asMap().entrySet().removeIf(entry -> {
                Collection<RepositoryAwareVerificationFailure> value = entry.getValue();
                return value.stream().noneMatch(wrapper -> wrapper.getFailure().isFatal());
            });
            VerificationReport report = reportWriter.generateReport(displayName, failures, verifier.getConfiguration().isUseKeyServers());
            String errorMessage = buildConsoleErrorMessage(report);
            if (verificationMode == DependencyVerificationMode.LENIENT) {
                LOGGER.error(errorMessage);
                failures.clear();
                hasFatalFailure.set(false);
            } else {
                throw new DependencyVerificationException(errorMessage);
            }
        }
    }
}
Also used : VerificationReport(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.report.VerificationReport) DependencyVerificationException(org.gradle.api.internal.artifacts.verification.DependencyVerificationException)

Aggregations

VerificationReport (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.report.VerificationReport)1 DependencyVerificationException (org.gradle.api.internal.artifacts.verification.DependencyVerificationException)1