use of org.gradle.api.internal.artifacts.verification.DependencyVerificationException 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);
}
}
}
}
use of org.gradle.api.internal.artifacts.verification.DependencyVerificationException in project gradle by gradle.
the class DependencyVerificationsXmlReader method readFromXml.
public static void readFromXml(InputStream in, DependencyVerifierBuilder builder) {
try {
SAXParser saxParser = createSecureParser();
XMLReader xmlReader = saxParser.getXMLReader();
VerifiersHandler handler = new VerifiersHandler(builder);
xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
xmlReader.setContentHandler(handler);
xmlReader.parse(new InputSource(in));
} catch (Exception e) {
throw new DependencyVerificationException("Unable to read dependency verification metadata", e);
} finally {
try {
in.close();
} catch (IOException e) {
throw UncheckedException.throwAsUncheckedException(e);
}
}
}
Aggregations