Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-06-18 08:10:40 -0400
committerIgor Fedorenko2014-06-18 08:10:40 -0400
commit4bc225a66ac0c9402f662734c4e6a5d929b83d58 (patch)
treec6f00c20717f9992083f2ffe895aa77860782bfe /org.eclipse.m2e.core
parent3c485f8b461f0fee1655d432cb1ce1284139fbe7 (diff)
downloadm2e-core-4bc225a66ac0c9402f662734c4e6a5d929b83d58.tar.gz
m2e-core-4bc225a66ac0c9402f662734c4e6a5d929b83d58.tar.xz
m2e-core-4bc225a66ac0c9402f662734c4e6a5d929b83d58.zip
437674 defer detachFromSession until the end of project refresh
Change-Id: Ic033b6afaf5e168d32b9784d7341608caa4e31fa Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.core')
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
index 227f019e..856af866 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
@@ -680,9 +680,6 @@ public class ProjectRegistryManager {
return null;
}
- // don't cache maven session
- getMaven().detachFromSession(mavenProject);
-
// create and return new project facade
MavenProjectFacade mavenProjectFacade = new MavenProjectFacade(ProjectRegistryManager.this, pom, mavenProject,
resolverConfiguration);
@@ -878,7 +875,14 @@ public class ProjectRegistryManager {
* @throws StaleMutableProjectRegistryException if primary project registry was modified after mutable registry has
* been created
*/
- void applyMutableProjectRegistry(MutableProjectRegistry newState, IProgressMonitor monitor) {
+ void applyMutableProjectRegistry(MutableProjectRegistry newState, IProgressMonitor monitor) throws CoreException {
+ // don't cache maven sessions
+ for(MavenProjectFacade facade : newState.getProjects()) {
+ MavenProject mavenProject = getMavenProject(facade);
+ if(mavenProject != null) {
+ getMaven().detachFromSession(mavenProject);
+ }
+ }
List<MavenProjectChangedEvent> events = projectRegistry.apply(newState);
//stateReader.writeWorkspaceState(projectRegistry);
notifyProjectChangeListeners(events, monitor);

Back to the top