From cf2386359f06f25b6105485910ff7c657ad04632 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sun, 22 Mar 2009 03:42:51 +0000 Subject: [PATCH] o no attempt should even be made to load a plugin descriptor again if for that gav it's been loaded, the plugin collector has the descriptor as found in the plugin JAR and after first processing the artifacts and realm is created so nothing else needs to be done for the base, set if plugin specific dependencies in the plugin are specified in a given project we'll wrap those, not recreate everything over again git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@757126 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/DefaultPluginManager.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 4636525b96..13cfb49520 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -152,10 +152,17 @@ public class DefaultPluginManager { return getByPrefix( prefix, session.getPluginGroups(), project.getRemoteArtifactRepositories(), session.getLocalRepository() ); } - + public PluginDescriptor loadPlugin( Plugin plugin, MavenProject project, MavenSession session ) throws PluginLoaderException { + PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( plugin ); + + if ( pluginDescriptor != null ) + { + return pluginDescriptor; + } + try { String pluginVersion = plugin.getVersion(); @@ -175,11 +182,12 @@ public class DefaultPluginManager addPlugin( plugin, project, session ); - PluginDescriptor result = pluginCollector.getPluginDescriptor( plugin ); + // This does not appear to be caching anything really. + pluginDescriptor = pluginCollector.getPluginDescriptor( plugin ); project.addPlugin( plugin ); - - return result; + + return pluginDescriptor; } catch ( ArtifactResolutionException e ) { @@ -279,9 +287,7 @@ public class DefaultPluginManager // Not going to happen } } - - pluginRealm.display(); - + try { logger.debug( "Discovering components in realm: " + pluginRealm );