in src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/GenerateMetadataMojo.java [763:783]
private void writeFilters(String sourceFilters) throws IOException, MojoExecutionException {
// if no filter is defined at all, fail
if (filters.getFilterSets().isEmpty()) {
throw new MojoExecutionException("No workspace filter defined!");
}
File filterFile = getGeneratedFilterFile(true);
// if the source filters and the generated filters are the same, copy the source file to retain the comments
if (filterSource != null && filters.getSourceAsString().equals(sourceFilters)) {
FileUtils.copyFile(filterSource, filterFile);
} else {
// generate xml and write to filter.xml
getLog().info("Generating filter.xml from plugin configuration");
FileUtils.fileWrite(filterFile.getAbsolutePath(), filters.getSourceAsString());
}
// update the last modified time of filter.xml to for generated filters
if (!filterFile.setLastModified(0)) {
getLog().warn("Unable to set last modified of filters file. make sure to clean the project before next run.");
}
}