MavenProjectChanges (@NotNull MavenProjectReaderResult readerResult, @NotNull MavenGeneralSettings settings, boolean updateLastReadStamp, boolean resetArtifacts, boolean resetProfiles) { State newState = myState.clone(); if (updateLastReadStamp) newState.myLastReadStamp = myState.myLastReadStamp + 1; newState.myReadingProblems = readerResult.readingProblems; newState.myLocalRepository = MavenUtil.resolveLocalRepository(settings.getLocalRepository(), staticOrBundled(settings.getMavenHomeType()), settings.getUserSettingsFile()); newState.myActivatedProfilesIds = readerResult.activatedProfiles; MavenModel model = readerResult.mavenModel; newState.myMavenId = model.getMavenId(); if (model.getParent() != null) { newState.myParentId = model.getParent().getMavenId(); } newState.myPackaging = model.getPackaging(); newState.myName = model.getName(); newState.myFinalName = model.getBuild().getFinalName(); newState.myDefaultGoal = model.getBuild().getDefaultGoal(); newState.myBuildDirectory = model.getBuild().getDirectory(); newState.myOutputDirectory = model.getBuild().getOutputDirectory(); newState.myTestOutputDirectory = model.getBuild().getTestOutputDirectory(); doSetFolders(newState, readerResult.mavenModel.getBuild()); newState.myFilters = model.getBuild().getFilters(); newState.myProperties = model.getProperties(); doSetResolvedAttributes(newState, readerResult, resetArtifacts); MavenModelPropertiesPatcher.patch(newState.myProperties, newState.myPlugins); newState.myModulesPathsAndNames = collectModulePathsAndNames(model, getDirectory()); Collection<String> newProfiles = collectProfilesIds(model.getProfiles()); if (resetProfiles || newState.myProfilesIds == null) { newState.myProfilesIds = newProfiles; } else { Set<String> mergedProfiles = new HashSet<>(newState.myProfilesIds); mergedProfiles.addAll(newProfiles); newState.myProfilesIds = new ArrayList<>(mergedProfiles); } newState.myModelMap = readerResult.nativeModelMap; return setState(newState); }