Revert "MNG-6209 better executeMojo thread context classloader" This reverts commit ec629f7d511eb910b4e80112a9fbe85ed8786f10.
Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/4b95ad9f Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/4b95ad9f Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/4b95ad9f Branch: refs/heads/MNG-6255 Commit: 4b95ad9fce6dfe7eec2be88f5837e96c7fbd7292 Parents: cae779e Author: Stephen Connolly <stephen.alan.conno...@gmail.com> Authored: Tue Oct 17 19:18:43 2017 +0100 Committer: Stephen Connolly <stephen.alan.conno...@gmail.com> Committed: Tue Oct 17 19:18:43 2017 +0100 ---------------------------------------------------------------------- .../java/org/apache/maven/plugin/DefaultBuildPluginManager.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/4b95ad9f/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java index 3af1125..b4f7a4d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java @@ -106,11 +106,8 @@ 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( tccl ); + Thread.currentThread().setContextClassLoader( pluginRealm ); MavenSession oldSession = legacySupport.getSession();