mirror of https://github.com/apache/maven.git
MNG-6209 better executeMojo thread context classloader
Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
This commit is contained in:
parent
567af0d964
commit
ec629f7d51
|
@ -106,8 +106,11 @@ public class DefaultBuildPluginManager
|
|||
throw new PluginExecutionException( mojoExecution, project, e );
|
||||
}
|
||||
|
||||
// use project realm as thread context classloader to enable components from all extensions=true plugins
|
||||
ClassRealm tccl = mojoExecution.getPlugin().isExtensions() ? project.getClassRealm() : pluginRealm;
|
||||
|
||||
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
Thread.currentThread().setContextClassLoader( pluginRealm );
|
||||
Thread.currentThread().setContextClassLoader( tccl );
|
||||
|
||||
MavenSession oldSession = legacySupport.getSession();
|
||||
|
||||
|
|
Loading…
Reference in New Issue