* Returns true if no orphans are found.
*/
private boolean collectVersionConflictsToIgnore() {
log("Checking for orphans in " + ignoreConflictsFile.getName(), verboseLevel);
boolean orphansFound = false;
InterpolatedProperties properties = new InterpolatedProperties();
try (InputStream inputStream = new FileInputStream(ignoreConflictsFile);
Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
properties.load(reader);
} catch (IOException e) {
throw new BuildException("Exception reading " + ignoreConflictsFile + ": " + e.toString(), e);
}
for (Object obj : properties.keySet()) {
String coordinate = (String)obj;
if (COORDINATE_KEY_PATTERN.matcher(coordinate).matches()) {
if ( ! directDependencies.containsKey(coordinate)) {
orphansFound = true;
log("ORPHAN coordinate key '" + coordinate + "' in " + ignoreConflictsFile.getName()
+ " is not found in " + centralizedVersionsFile.getName(),
Project.MSG_ERR);
} else {
String versionsToIgnore = properties.getProperty(coordinate);
List<String> ignore = Arrays.asList(versionsToIgnore.trim().split("\\s*,\\s*|\\s+"));
ignoreConflictVersions.put(coordinate, new HashSet<>(ignore));
}
}
}