in src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/GenerateCndMojo.java [101:126]
public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Retrieving used node types and namespaces...");
try {
StandaloneManagerProvider managerProvider = new StandaloneManagerProvider();
URLFactory.processUrlStreams(CndUtil.resolveJarUrls(additionalInputCndUrls), t -> {
try {
managerProvider.registerNodeTypes(t);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
catch (ParseException | RepositoryException e) {
throw new IllegalArgumentException(e);
}
});
File cndOutputFile = new File(getGeneratedVaultDir(true), Constants.NODETYPES_CND);
File jcrSourceDirectory = getJcrSourceDirectory();
if (jcrSourceDirectory == null) {
getLog().warn("None of the configured jcrRootSourceDirectory directories exists, skipping generating the CND!");
} else {
int numWrittenNodeTypes = generateCnd(managerProvider, cndOutputFile.toPath(), getJcrSourceDirectory().toPath());
getLog().info("Written " + numWrittenNodeTypes + " node types to CND file " + getProjectRelativeFilePath(cndOutputFile));
}
} catch (IOException | RepositoryException | ParseException | IllegalStateException e) {
throw new MojoExecutionException("Error while writing CND: " + e.toString(), e);
}
}