in src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/ValidatePackageMojo.java [144:164]
private void validatePackage(ValidationMessagePrinter validationHelper, Path file) throws MojoExecutionException, MojoFailureException {
getLog().info("Start validating package " + getProjectRelativeFilePath(file) + "...");
// open file to extract the meta data for the validation context
ArchiveValidationContext context;
ValidationExecutor executor;
try (Archive archive = new ZipArchive(file.toFile())) {
archive.open(true);
context = new ArchiveValidationContext(archive, file, resolver);
executor = validationExecutorFactory.createValidationExecutor(context, false, enforceRecursiveSubpackageValidation, getEffectiveValidatorSettingsForPackage(context.getProperties().getId(), false));
if (executor != null) {
validationHelper.printUsedValidators(getLog(), executor, context, true);
validateArchive(validationHelper, archive, file, context, executor);
} else {
throw new MojoExecutionException("No registered validators found!");
}
getLog().debug("End validating package " + getProjectRelativeFilePath(file) + ".");
} catch (IOException | ParserConfigurationException | SAXException e) {
throw new MojoExecutionException("Could not validate package '" + file + "': " + e.getMessage(), e);
}
}