mirror of https://github.com/apache/maven.git
Use plugin realm to lookup plugin components - fixes custom lifecycle mappings
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@497491 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c783818ab2
commit
18b83fe00a
|
@ -1207,20 +1207,31 @@ public class DefaultPluginManager
|
|||
}
|
||||
}
|
||||
|
||||
public Object getPluginComponent( Plugin plugin,
|
||||
String role,
|
||||
String roleHint )
|
||||
public Object getPluginComponent( Plugin plugin, String role, String roleHint )
|
||||
throws PluginManagerException, ComponentLookupException
|
||||
{
|
||||
// XXX this needs the plugin realm!
|
||||
return container.lookup( role, roleHint );
|
||||
ClassRealm pluginRealm = pluginCollector.getPluginDescriptor( plugin ).getClassRealm();
|
||||
|
||||
if ( pluginRealm == null )
|
||||
{
|
||||
getLogger().warn( "getPluginComponent(" + plugin + ", " + role + "): descriptor is missing classRealm" );
|
||||
pluginRealm = DefaultPlexusContainer.getLookupRealm();
|
||||
}
|
||||
|
||||
return container.lookup( role, roleHint, pluginRealm );
|
||||
}
|
||||
|
||||
public Map getPluginComponents( Plugin plugin,
|
||||
String role )
|
||||
public Map getPluginComponents( Plugin plugin, String role )
|
||||
throws ComponentLookupException, PluginManagerException
|
||||
{
|
||||
// XXX this needs the plugin realm!
|
||||
return container.lookupMap( role );
|
||||
ClassRealm pluginRealm = pluginCollector.getPluginDescriptor( plugin ).getClassRealm();
|
||||
|
||||
if ( pluginRealm == null )
|
||||
{
|
||||
getLogger().warn( "getPluginComponent(" + plugin + ", " + role + "): descriptor is missing classRealm" );
|
||||
pluginRealm = DefaultPlexusContainer.getLookupRealm();
|
||||
}
|
||||
|
||||
return container.lookupMap( role, pluginRealm );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue