From 8e7dc9ef14d43bf42e3c1522c05f95035016475f Mon Sep 17 00:00:00 2001 From: Kenney Westerhof Date: Thu, 18 Jan 2007 05:22:08 +0000 Subject: [PATCH] Realm fixes git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@497305 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugin/DefaultPluginManager.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 8ef67036d8..b70d20daad 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -615,11 +615,11 @@ public class DefaultPluginManager // the lifecycle that is part of the lookup. Here we are specifically trying to keep // lookups that occur in contextualize calls in line with the right realm. - DefaultPlexusContainer.setLookupRealm( realm ); + ClassRealm oldRealm = DefaultPlexusContainer.setLookupRealm( realm ); plugin = (Mojo) container.lookup( Mojo.ROLE, mojoDescriptor.getRoleHint() ); - DefaultPlexusContainer.setLookupRealm( null ); + DefaultPlexusContainer.setLookupRealm( oldRealm ); if ( report && !( plugin instanceof MavenReport ) ) { @@ -1073,11 +1073,11 @@ public class DefaultPluginManager if ( StringUtils.isNotEmpty( configuratorId ) ) { configurator = - (ComponentConfigurator) pluginContainer.lookup( ComponentConfigurator.ROLE, configuratorId ); + (ComponentConfigurator) pluginContainer.lookup( ComponentConfigurator.ROLE, configuratorId, pluginRealm ); } else { - configurator = (ComponentConfigurator) pluginContainer.lookup( ComponentConfigurator.ROLE ); + configurator = (ComponentConfigurator) pluginContainer.lookup( ComponentConfigurator.ROLE, pluginRealm ); } ConfigurationListener listener = new DebugConfigurationListener( getLogger() ); @@ -1209,6 +1209,7 @@ public class DefaultPluginManager String roleHint ) throws PluginManagerException, ComponentLookupException { + // XXX this needs the plugin realm! return container.lookup( role, roleHint ); } @@ -1216,6 +1217,7 @@ public class DefaultPluginManager String role ) throws ComponentLookupException, PluginManagerException { + // XXX this needs the plugin realm! return container.lookupMap( role ); } }