}
}
final String topLevel = reader.getLocalName();
if (!"settings".equals(topLevel)) {
throw new InvalidConfigurationFileException("Invalid format settings.xml found: "
+ userSettingsFile);
}
} catch (final FileNotFoundException e) {
// Ignore at this level
} catch (final XMLStreamException xmlse) {
throw new RuntimeException("Could not check file format of specified settings.xml: "
+ userSettingsFile, xmlse);
}
}
result = builder.build(request);
}
// wrap exception message
catch (SettingsBuildingException e) {
StringBuilder sb = new StringBuilder("Found ").append(e.getProblems().size())
.append(" problems while building settings.xml model from both global Maven configuration file")
.append(request.getGlobalSettingsFile()).append(" and/or user configuration file: ")
.append(request.getUserSettingsFile()).append("\n");
int counter = 1;
for (SettingsProblem problem : e.getProblems()) {
sb.append(counter++).append("/ ").append(problem).append("\n");
}
throw new InvalidConfigurationFileException(sb.toString());
}
// get settings object and update it according to property values
Settings settings = result.getEffectiveSettings();
settings = enrichWithLocalRepository(settings);