Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2015-03-25 13:15:59 -0400
committerIgor Fedorenko2015-03-25 13:15:59 -0400
commit95b4c85c345ac0eb69e1c69c50aa99150a940cc4 (patch)
treecb05336aa07539cd78a525f65ca50d8d6b9538c0 /org.eclipse.m2e.core
parent0ded6adfe181734d22b4a08b75e74123ffe83b8d (diff)
downloadm2e-core-95b4c85c345ac0eb69e1c69c50aa99150a940cc4.tar.gz
m2e-core-95b4c85c345ac0eb69e1c69c50aa99150a940cc4.tar.xz
m2e-core-95b4c85c345ac0eb69e1c69c50aa99150a940cc4.zip
463075 don't force-flush project realms
The same project realm can be shared by multiple projects and ProjectRealmCache manages project/realm association, including disposal of unused realms as needed. Disposing project realms of each project refresh is both redundant and can cause problems when some projects that reference the same realm are not refreshed. Change-Id: I6cbf3dc5e61b0594d4604935f8a3d07d57b3930e 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/embedder/MavenImpl.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java3
2 files changed, 0 insertions, 20 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
index 7950f845..1d9b06db 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
@@ -59,7 +59,6 @@ import org.eclipse.osgi.util.NLS;
import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
-import org.codehaus.plexus.MutablePlexusContainer;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
@@ -1034,22 +1033,6 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
}, monitor);
}
- /**
- * Temporary solution/workaround for http://jira.codehaus.org/browse/MNG-4194. Extensions realm is created each time
- * MavenProject instance is built, so we have to remove unused extensions realms to avoid OOME.
- */
- public void releaseExtensionsRealm(MavenProject project) {
- ClassRealm realm = project.getClassRealm();
- if(realm != null && realm != plexus.getContainerRealm()) {
- ClassWorld world = ((MutablePlexusContainer) plexus).getClassWorld();
- try {
- world.disposeRealm(realm.getId());
- } catch(NoSuchRealmException ex) {
- log.error("Could not dispose of project extensions class realm", ex);
- }
- }
- }
-
public ArtifactRepository createArtifactRepository(String id, String url) throws CoreException {
Repository repository = new Repository();
repository.setId(id);
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 0c3d0518..66bacab4 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
@@ -1109,9 +1109,6 @@ public class ProjectRegistryManager {
affected.addAll(flushMavenCache(PluginRealmCache.class, pom, key, force));
affected.addAll(flushMavenCache(MavenMetadataCache.class, pom, key, force));
affected.addAll(flushMavenCache(PluginArtifactsCache.class, pom, key, force));
- if(project != null) {
- ((MavenImpl) getMaven()).releaseExtensionsRealm(project);
- }
return affected;
}

Back to the top