in src/main/java/org/apache/maven/buildcache/checksum/exclude/ExclusionResolver.java [65:101]
public ExclusionResolver(MavenProject project, CacheConfig config) {
addDefaultExcludes(project);
Path baseDirectory = project.getBasedir().toPath().toAbsolutePath();
projectBaseDirectory = baseDirectory;
// Global exclusions
List<Exclude> excludes = config.getGlobalExcludePaths();
for (Exclude exclude : excludes) {
addExclusion(baseDirectory, exclude);
}
// Project specific exclusions
Properties properties = project.getProperties();
Map<String, Exclude> propertyMap = new HashMap<>();
for (String propertyName : properties.stringPropertyNames()) {
if (propertyName.startsWith(PROJECT_PROPERTY_EXCLUDE_VALUE)) {
String propertyKey = propertyName.substring(PROJECT_PROPERTY_EXCLUDE_VALUE.length());
Exclude exclude = propertyMap.computeIfAbsent(propertyKey, key -> new Exclude());
exclude.setValue(properties.getProperty(propertyName));
} else if (propertyName.startsWith(PROJECT_PROPERTY_EXCLUDE_GLOB)) {
String propertyKey = propertyName.substring(PROJECT_PROPERTY_EXCLUDE_GLOB.length());
Exclude exclude = propertyMap.computeIfAbsent(propertyKey, key -> new Exclude());
exclude.setGlob(properties.getProperty(propertyName));
} else if (propertyName.startsWith(PROJECT_PROPERTY_EXCLUDE_ENTRY_TYPE)) {
String propertyKey = propertyName.substring(PROJECT_PROPERTY_EXCLUDE_ENTRY_TYPE.length());
Exclude exclude = propertyMap.computeIfAbsent(propertyKey, key -> new Exclude());
exclude.setEntryType(properties.getProperty(propertyName));
} else if (propertyName.startsWith(PROJECT_PROPERTY_EXCLUDE_MATCHER_TYPE)) {
String propertyKey = propertyName.substring(PROJECT_PROPERTY_EXCLUDE_MATCHER_TYPE.length());
Exclude exclude = propertyMap.computeIfAbsent(propertyKey, key -> new Exclude());
exclude.setMatcherType(properties.getProperty(propertyName));
}
}
for (Exclude propertyExclude : propertyMap.values()) {
addExclusion(baseDirectory, propertyExclude);
}
}