From 35cb99184499d92777326b066f61516a82142af7 Mon Sep 17 00:00:00 2001 From: Britton Isbell Date: Fri, 12 Sep 2008 17:04:32 +0000 Subject: [PATCH] Fix: IT0074. When I removed Maven20xCompatAspect.aj, I removed code that fixed mng-3012. Added the code directly back into DefaultMavenRealmManager. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@694742 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/realm/DefaultMavenRealmManager.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/maven-project/src/main/java/org/apache/maven/realm/DefaultMavenRealmManager.java b/maven-project/src/main/java/org/apache/maven/realm/DefaultMavenRealmManager.java index 30191a7a85..03a4f8ef45 100644 --- a/maven-project/src/main/java/org/apache/maven/realm/DefaultMavenRealmManager.java +++ b/maven-project/src/main/java/org/apache/maven/realm/DefaultMavenRealmManager.java @@ -24,6 +24,7 @@ import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.model.Plugin; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainerException; +import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.classworlds.ClassWorld; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.classworlds.realm.DuplicateRealmException; @@ -246,14 +247,27 @@ public class DefaultMavenRealmManager logger.debug( "Retrieving realm for plugin with id: " + id ); + ClassRealm pluginRealm = null; + try { - return world.getRealm( id ); + pluginRealm = world.getRealm( id ); + + //MNG-3012 + String parentRealmId = container.getContainerRealm().getId(); + pluginRealm.importFrom( parentRealmId, Xpp3Dom.class.getName() ); + pluginRealm.importFrom( parentRealmId, "org.codehaus.plexus.util.xml.pull" ); + } catch ( NoSuchRealmException e ) { - return null; + } + finally + { + return pluginRealm; + } + } public void disposePluginRealm( Plugin plugin )