in src/main/java/org/apache/jackrabbit/filevault/maven/packaging/impl/DirectoryValidationContext.java [54:88]
public DirectoryValidationContext(boolean isIncremental, @NotNull final Path generatedMetaInfRootDirectory, final Path metaInfRootDirectory,
@NotNull final Path packageRootDirectory, DependencyResolver resolver, @NotNull final Log log) throws IOException, ConfigurationException {
Path propertiesPath = null;
if (!Constants.META_INF.equals(generatedMetaInfRootDirectory.getFileName().toString())) {
throw new IllegalArgumentException("The workDir must end with 'META-INF' but is '" + generatedMetaInfRootDirectory+"'");
}
if (metaInfRootDirectory != null) {
if (!Constants.META_INF.equals(metaInfRootDirectory.getFileName().toString())) {
throw new IllegalArgumentException("The metaInfRootDirectory must end with 'META-INF' but is '" + metaInfRootDirectory+"'");
}
propertiesPath = metaInfRootDirectory.resolve(Constants.VAULT_DIR).resolve(Constants.PROPERTIES_XML);
}
if (propertiesPath == null || !Files.exists(propertiesPath)) {
propertiesPath = generatedMetaInfRootDirectory.resolve(RELATIVE_PROPERTIES_XML_PATH);
if (!Files.exists(propertiesPath)) {
throw new IllegalStateException("No '" + RELATIVE_PROPERTIES_XML_PATH + "' found in either '" +metaInfRootDirectory + "' or '" + generatedMetaInfRootDirectory + "'");
}
log.debug("Using '" + RELATIVE_PROPERTIES_XML_PATH + "' from directory " + generatedMetaInfRootDirectory);
} else {
log.debug("Using '" + RELATIVE_PROPERTIES_XML_PATH + "' from directory " + metaInfRootDirectory);
}
properties = DefaultPackageProperties.fromFile(propertiesPath);
// filter always comes from the workDir
filter = new DefaultWorkspaceFilter();
Path filterFile = generatedMetaInfRootDirectory.resolve(Paths.get(Constants.VAULT_DIR, Constants.FILTER_XML));
if (!Files.isRegularFile(filterFile)) {
throw new IllegalStateException("No mandatory '" + Constants.VAULT_DIR +"/"+Constants.FILTER_XML + "' found in " + generatedMetaInfRootDirectory + "'");
}
filter.load(filterFile.toFile());
this.resolvedDependencies = resolver.resolvePackageInfo(getProperties().getDependencies(), getProperties().getDependenciesLocations());
this.isIncremental = isIncremental;
this.packageRootDirectory = packageRootDirectory;
}