public void configureSettingsFromFile(File globalSettings, File userSettings)
        throws InvalidConfigurationFileException {

        SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
        if (globalSettings != null) {
            request.setGlobalSettingsFile(globalSettings);
        }
        if (userSettings != null) {
            request.setUserSettingsFile(userSettings);
        }
        request.setSystemProperties(SecurityActions.getProperties());

        MavenSettingsBuilder builder = new MavenSettingsBuilder();
        this.settings = builder.buildSettings(request);

        // ensure we keep offline(boolean) if previously set
        propagateProgrammaticOfflineIntoSettings();
    }
public void configureSettingsFromFile ( File globalSettings , File userSettings ) throws InvalidConfigurationFileException { SettingsBuildingRequest request = new DefaultSettingsBuildingRequest ( ) ; if ( globalSettings != null ) { request . setGlobalSettingsFile ( globalSettings ) ; } if ( userSettings != null ) { request . setUserSettingsFile ( userSettings ) ; } request . setSystemProperties ( SecurityActions . getProperties ( ) ) ; MavenSettingsBuilder builder = new MavenSettingsBuilder ( ) ; this . settings = builder . buildSettings ( request ) ; propagateProgrammaticOfflineIntoSettings ( ) ; }
Crates an instance of {@link Settings} and configures it from the given file.

@param globalSettings path to global settings file
@param userSettings   path to user settings file