slawekjaranowski commented on code in PR #1142: URL: https://github.com/apache/maven/pull/1142#discussion_r1234169184
########## maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java: ########## @@ -104,6 +106,26 @@ public SettingsBuildingResult build(SettingsBuildingRequest request) throws Sett settingsMerger.merge(projectSettings, globalSettings, TrackableBase.GLOBAL_LEVEL); settingsMerger.merge(userSettings, projectSettings, TrackableBase.PROJECT_LEVEL); + // If no repository is defined in the user/global settings, + // it means that we have "old" settings (as those are new in 4.0) + // so add central to the computed settings for backward compatibility. + if (userSettings.getRepositories().isEmpty() + && userSettings.getPluginRepositories().isEmpty()) { + Repository central = new Repository(); + central.setId("central"); + central.setName("Central Repository"); + central.setUrl("https://repo.maven.apache.org/maven2"); + RepositoryPolicy disabledPolicy = new RepositoryPolicy(); + disabledPolicy.setEnabled(false); + central.setSnapshots(disabledPolicy); + userSettings.getRepositories().add(central); + central = central.clone(); + RepositoryPolicy updateNeverPolicy = new RepositoryPolicy(); + disabledPolicy.setUpdatePolicy("never"); Review Comment: here we override update policy - but in settings.xml we don't such it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org