void (MavenGeneralSettings generalSettings, MavenModel model, Set<String> alwaysOnProfiles, Collection<MavenProjectProblem> problems) { if (mySettingsProfilesCache == null) { List<MavenProfile> settingsProfiles = new ArrayList<>(); Collection<MavenProjectProblem> settingsProblems = MavenProjectProblem.createProblemsList(); Set<String> settingsAlwaysOnProfiles = new HashSet<>(); for (VirtualFile each : generalSettings.getEffectiveSettingsFiles()) { collectProfilesFromSettingsXmlOrProfilesXml(each, "settings", false, MavenConstants.PROFILE_FROM_SETTINGS_XML, settingsProfiles, settingsAlwaysOnProfiles, settingsProblems); } mySettingsProfilesCache = new SettingsProfilesCache(settingsProfiles, settingsAlwaysOnProfiles, settingsProblems); } List<MavenProfile> modelProfiles = new ArrayList<>(model.getProfiles()); for (MavenProfile each : mySettingsProfilesCache.profiles) { addProfileIfDoesNotExist(each, modelProfiles); } model.setProfiles(modelProfiles); problems.addAll(mySettingsProfilesCache.problems); alwaysOnProfiles.addAll(mySettingsProfilesCache.alwaysOnProfiles); }