Search in sources :

Example 1 with DefaultSettingsReader

use of org.apache.maven.settings.io.DefaultSettingsReader in project gradle by gradle.

the class DefaultMavenSettingsProvider method readLocalRepository.

private String readLocalRepository(File settingsFile) {
    if (settingsFile == null || !settingsFile.exists()) {
        return null;
    }
    Map<String, ?> options = Collections.singletonMap(SettingsReader.IS_STRICT, Boolean.FALSE);
    SettingsReader settingsReader = new DefaultSettingsReader();
    try {
        return settingsReader.read(settingsFile, options).getLocalRepository();
    } catch (Exception parseException) {
        throw new CannotLocateLocalMavenRepositoryException("Unable to parse local Maven settings: " + settingsFile.getAbsolutePath(), parseException);
    }
}
Also used : SettingsReader(org.apache.maven.settings.io.SettingsReader) DefaultSettingsReader(org.apache.maven.settings.io.DefaultSettingsReader) DefaultSettingsReader(org.apache.maven.settings.io.DefaultSettingsReader) SettingsBuildingException(org.apache.maven.settings.building.SettingsBuildingException)

Aggregations

SettingsBuildingException (org.apache.maven.settings.building.SettingsBuildingException)1 DefaultSettingsReader (org.apache.maven.settings.io.DefaultSettingsReader)1 SettingsReader (org.apache.maven.settings.io.SettingsReader)1