From 47b77c1df6b11fa74400ea1093d866e5d6f9ca60 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Thu, 11 Jun 2009 07:08:21 +0000 Subject: [PATCH] o removing an exception not used git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@783651 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/DefaultPluginManager.java | 18 +++--------------- .../org/apache/maven/plugin/PluginManager.java | 17 +++-------------- 2 files changed, 6 insertions(+), 29 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 fe559ed55e..c68d3a5a3b 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 @@ -77,11 +77,8 @@ import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.XmlStreamReader; import org.codehaus.plexus.util.xml.Xpp3Dom; -// TODO: get plugin groups // TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think about how that works // TODO: remove the coreArtifactFilterManager -// TODO: rework the plugin classloader/plugin descriptor caching -// TODO: surface all exceptions to the handler: get rid of generic useless exceptions @Component(role = PluginManager.class) public class DefaultPluginManager @@ -90,7 +87,7 @@ public class DefaultPluginManager @Requirement private Logger logger; - @Requirement(role=PlexusContainer.class) + @Requirement protected PlexusContainer container; @Requirement @@ -121,15 +118,6 @@ public class DefaultPluginManager public synchronized PluginDescriptor loadPlugin( Plugin plugin, ArtifactRepository localRepository, List remoteRepositories ) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, CycleDetectedInPluginGraphException, InvalidPluginDescriptorException { -// PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin ); - - // There are cases where plugins are discovered but not actually populated. These are edge cases where you are working in the IDE on - // Maven itself so this speaks to a problem we have with the system not starting entirely clean. -// if ( pluginDescriptor != null && pluginDescriptor.getClassRealm() != null ) -// { -// return pluginDescriptor; -// } - PluginDescriptor pluginDescriptor = pluginCache.getPluginDescriptor( plugin, localRepository, remoteRepositories ); if ( pluginDescriptor != null ) @@ -137,7 +125,6 @@ public class DefaultPluginManager return pluginDescriptor; } - Artifact pluginArtifact = repositorySystem.createPluginArtifact( plugin ); ArtifactResolutionRequest request = new ArtifactResolutionRequest() @@ -373,7 +360,8 @@ public class DefaultPluginManager * TODO pluginDescriptor classRealm and artifacts are set as a side effect of this * call, which is not nice. */ - public synchronized ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) throws PluginManagerException + public synchronized ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) + throws PluginManagerException { ClassRealm pluginRealm = pluginDescriptor.getClassRealm(); if ( pluginRealm != null ) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java index 3e122667b8..a23eba27a9 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java @@ -29,16 +29,6 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm; */ public interface PluginManager { - // - find the plugin [extension point: any client may wish to do whatever they choose] - // - load the plugin into a classloader [extension point: we want to take them from a repository, some may take from disk or whatever] - // - configure the plugin [extension point] -- actually this should happen before the plugin manager gets anything i.e. do whatever you want to get the information - // - execute the plugin - - // Use more meaningful exceptions - // plugin not found - // plugin resolution exception - // plugin configuration can't be parsed -- and this may be a result of client insertion of configuration - // plugin component deps have a cycle -- this should be prevented for the most part but client code may inject an override component which itself has a cycle // igorf: Way too many declared exceptions! PluginDescriptor loadPlugin( Plugin plugin, ArtifactRepository localRepository, List remoteRepositories ) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, CycleDetectedInPluginGraphException, InvalidPluginDescriptorException; @@ -51,10 +41,9 @@ public interface PluginManager MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, ArtifactRepository localRepository, List remoteRepositories ) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, CycleDetectedInPluginGraphException, MojoNotFoundException, InvalidPluginDescriptorException; - // Why do we have a plugin execution exception as well? - // igorf: Way too many declared exceptions! void executeMojo( MavenSession session, MojoExecution execution ) - throws MojoFailureException, MojoExecutionException, PluginConfigurationException, PluginExecutionException, PluginManagerException; + throws MojoFailureException, MojoExecutionException, PluginConfigurationException, PluginManagerException; - ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) throws PluginManagerException; + ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) + throws PluginManagerException; } \ No newline at end of file