o adding some patches for changes in plexus

submitted by: Dain Sundstrom


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@718845 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2008-11-19 02:31:49 +00:00
parent f88b524249
commit 17d68dbce5
2 changed files with 10 additions and 1 deletions

View File

@ -813,6 +813,11 @@ private Mojo getConfiguredMojo( MavenSession session,
// lookups that occur in contextualize calls in line with the right realm. // lookups that occur in contextualize calls in line with the right realm.
container.setLookupRealm( pluginRealm ); container.setLookupRealm( pluginRealm );
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader( pluginRealm );
try
{
getLogger().debug( getLogger().debug(
"Looking up mojo " + mojoDescriptor.getRoleHint() + " in realm " "Looking up mojo " + mojoDescriptor.getRoleHint() + " in realm "
+ pluginRealm.getId() + " - descRealmId=" + pluginRealm.getId() + " - descRealmId="
@ -900,6 +905,10 @@ private Mojo getConfiguredMojo( MavenSession session,
populatePluginFields( mojo, mojoDescriptor, extractedMojoConfiguration, expressionEvaluator ); populatePluginFields( mojo, mojoDescriptor, extractedMojoConfiguration, expressionEvaluator );
return mojo; return mojo;
} finally {
Thread.currentThread().setContextClassLoader( oldClassLoader );
}
} }
private void checkDeprecatedParameters( MojoDescriptor mojoDescriptor, private void checkDeprecatedParameters( MojoDescriptor mojoDescriptor,

View File

@ -66,7 +66,7 @@ public void customize( PlexusContainer container )
public void testComponentOverride() public void testComponentOverride()
throws ComponentLookupException throws ComponentLookupException
{ {
ArtifactFactory factory = (ArtifactFactory) container.lookup( ArtifactFactory.class ); ArtifactFactory factory = container.lookup( ArtifactFactory.class );
assertNotNull( factory ); assertNotNull( factory );