in src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java [155:178]
private void validate(final File file) throws MojoExecutionException {
getLog().debug("Validating " + file.getPath());
if ( file.isFile() ) {
if ( file.getName().endsWith(".json") && !this.skipJson ) {
getLog().debug("Validation JSON file " + file.getPath());
FileInputStream fis = null;
String json = null;
try {
fis = new FileInputStream(file);
json = IOUtils.toString(fis, StandardCharsets.UTF_8);
} catch (IOException ex) {
throw new MojoExecutionException(ex.getMessage(), ex);
} finally {
IOUtils.closeQuietly(fis);
}
// validate JSON
try {
JsonSupport.validateJsonStructure(json, jsonQuoteTick);
} catch (JsonException ex) {
throw new MojoExecutionException("Invalid JSON: " + ex.getMessage());
}
}
}
}