mirror of https://github.com/apache/maven.git
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@773470 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4446b8dba7
commit
4a046065c4
|
@ -12,12 +12,12 @@ public class DefaultPluginClassLoaderCache
|
||||||
{
|
{
|
||||||
private Map<String,ClassRealm> pluginClassLoaders = new HashMap<String,ClassRealm>();
|
private Map<String,ClassRealm> pluginClassLoaders = new HashMap<String,ClassRealm>();
|
||||||
|
|
||||||
public void cachePluginClassLoader( String key, ClassRealm pluginClassLoader )
|
public void put( String key, ClassRealm pluginClassLoader )
|
||||||
{
|
{
|
||||||
pluginClassLoaders.put( key, pluginClassLoader );
|
pluginClassLoaders.put( key, pluginClassLoader );
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClassRealm getPluginClassLoader( String key )
|
public ClassRealm get( String key )
|
||||||
{
|
{
|
||||||
return pluginClassLoaders.get( key );
|
return pluginClassLoaders.get( key );
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ public class DefaultPluginManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//pluginRealm.display();
|
pluginRealm.display();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -215,7 +215,7 @@ public class DefaultPluginManager
|
||||||
throw new PluginContainerException( plugin, pluginRealm, "Error scanning plugin realm for components.", e );
|
throw new PluginContainerException( plugin, pluginRealm, "Error scanning plugin realm for components.", e );
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginClassLoaderCache.cachePluginClassLoader( constructPluginKey( plugin ), pluginRealm );
|
pluginClassLoaderCache.put( constructPluginKey( plugin ), pluginRealm );
|
||||||
|
|
||||||
PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin );
|
PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin );
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ public class DefaultPluginManager
|
||||||
mojo = getConfiguredMojo( session, mojoExecution, project, false, mojoExecution );
|
mojo = getConfiguredMojo( session, mojoExecution, project, false, mojoExecution );
|
||||||
|
|
||||||
//pluginRealm = pluginDescriptor.getClassRealm();
|
//pluginRealm = pluginDescriptor.getClassRealm();
|
||||||
pluginRealm = pluginClassLoaderCache.getPluginClassLoader( constructPluginKey( mojoDescriptor.getPluginDescriptor() ) );
|
pluginRealm = pluginClassLoaderCache.get( constructPluginKey( mojoDescriptor.getPluginDescriptor() ) );
|
||||||
|
|
||||||
Thread.currentThread().setContextClassLoader( pluginRealm );
|
Thread.currentThread().setContextClassLoader( pluginRealm );
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||||
*/
|
*/
|
||||||
public interface PluginClassLoaderCache
|
public interface PluginClassLoaderCache
|
||||||
{
|
{
|
||||||
void cachePluginClassLoader( String key, ClassRealm pluginClassLoader );
|
void put( String key, ClassRealm pluginClassLoader );
|
||||||
|
|
||||||
ClassRealm getPluginClassLoader( String key );
|
ClassRealm get( String key );
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ public class PluginParameterExpressionEvaluator
|
||||||
value = project.getExecutionProject();
|
value = project.getExecutionProject();
|
||||||
}
|
}
|
||||||
else if ( expression.startsWith( "project" ) || expression.startsWith( "pom" ) )
|
else if ( expression.startsWith( "project" ) || expression.startsWith( "pom" ) )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int pathSeparator = expression.indexOf( "/" );
|
int pathSeparator = expression.indexOf( "/" );
|
||||||
|
@ -187,7 +187,7 @@ public class PluginParameterExpressionEvaluator
|
||||||
// TODO: don't catch exception
|
// TODO: don't catch exception
|
||||||
throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression,
|
throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression,
|
||||||
e );
|
e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( expression.equals( "mojo" ) )
|
else if ( expression.equals( "mojo" ) )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue