org.apache.maven.plugin
Class PluginManager

java.lang.Object
  extended byorg.apache.maven.AbstractMavenComponent
      extended byorg.apache.maven.plugin.PluginManager

public class PluginManager
extends AbstractMavenComponent

Plugin manager for MavenSession.

The PluginManager deals with all aspects of a plugins lifecycle.

This is not thread safe.

Version:
$Id: PluginManager.java,v 1.70.4.52 2004/07/07 10:09:08 brett Exp $
Author:
Jason van Zyl, bob mcwhirter, Brett Porter

Field Summary
static java.lang.String BASE_CONTEXT
           
static java.lang.String GLOBAL_SESSION_KEY
          The variable key that holds an implementation of the com.werken.werkz.Session in the parent scope context.
static java.lang.String GOAL_MAPPER
           
static java.lang.String PLUGIN_HOUSING
           
static java.lang.String PLUGIN_MANAGER
           
 
Constructor Summary
PluginManager(MavenSession session)
          Default constructor.
 
Method Summary
 void addDelayedPops(java.util.Set set)
           
 void attainGoals(Project project, java.util.List goals)
          Attain the goals.
 void cleanupAttainGoal(java.util.Set pluginSet)
           
 java.lang.String getGoalDescription(java.lang.String goalName)
           
 java.util.Set getGoalNames()
           
 java.util.Set getGoalNames(Project project)
          Warning - this completely scrogs the default mapper.
 MavenJellyContext getPluginContext(java.lang.String id)
           
 java.util.Collection getPluginList()
           
 Project getPluginProjectFromGoal(java.lang.String goal)
           
 void initialize()
          Initialize all plugins.
 void installPlugin(java.io.File file, Project parentProject)
           
 void installPlugin(java.io.File file, Project parentProject, boolean cache)
          Load and install a plugin.
 java.util.Set prepAttainGoal(java.lang.String goalName, MavenJellyContext baseContext, GoalToJellyScriptHousingMapper goalMapper)
          Use the name of a goal to lookup all the plugins (that are stored in the plugin housings) that need to be executed in order to satisfy all the required preconditions for successful goal attainment.
 void processDependencies(Project project)
          Process the dependencies of the project, adding dependencies to the appropriate classloader etc
 void uninstallPlugin(java.lang.String artifactId)
           
 
Methods inherited from class org.apache.maven.AbstractMavenComponent
getMessage, getMessage, getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_SESSION_KEY

public static final java.lang.String GLOBAL_SESSION_KEY
The variable key that holds an implementation of the com.werken.werkz.Session in the parent scope context.

See Also:
Constant Field Values

PLUGIN_MANAGER

public static final java.lang.String PLUGIN_MANAGER
See Also:
Constant Field Values

PLUGIN_HOUSING

public static final java.lang.String PLUGIN_HOUSING
See Also:
Constant Field Values

GOAL_MAPPER

public static final java.lang.String GOAL_MAPPER
See Also:
Constant Field Values

BASE_CONTEXT

public static final java.lang.String BASE_CONTEXT
See Also:
Constant Field Values
Constructor Detail

PluginManager

public PluginManager(MavenSession session)
Default constructor.

Parameters:
session - The MavenSession this plugin manager will use until Maven shuts down.
Method Detail

initialize

public void initialize()
                throws java.io.IOException,
                       MavenException
Initialize all plugins.

Throws:
java.lang.Exception - If an error occurs while initializing any plugin.
java.io.IOException
MavenException

processDependencies

public void processDependencies(Project project)
                         throws java.net.MalformedURLException,
                                java.lang.Exception
Process the dependencies of the project, adding dependencies to the appropriate classloader etc

Throws:
java.net.MalformedURLException - if a file can't be converted to a URL.
java.lang.Exception - for any other issue. FIXME

attainGoals

public void attainGoals(Project project,
                        java.util.List goals)
                 throws java.lang.Exception
Attain the goals.

Throws:
java.lang.Exception - If one of the specified goals refers to an non-existent goal.
java.lang.Exception - If an exception occurs while running a goal.

cleanupAttainGoal

public void cleanupAttainGoal(java.util.Set pluginSet)
                       throws java.lang.Exception
Throws:
java.lang.Exception

prepAttainGoal

public java.util.Set prepAttainGoal(java.lang.String goalName,
                                    MavenJellyContext baseContext,
                                    GoalToJellyScriptHousingMapper goalMapper)
                             throws java.lang.Exception
Use the name of a goal to lookup all the plugins (that are stored in the plugin housings) that need to be executed in order to satisfy all the required preconditions for successful goal attainment.

Parameters:
goalName - the goal
baseContext - the base context to attain in
Returns:
a set of plugins required to attain the goal
Throws:
java.lang.Exception

getGoalNames

public java.util.Set getGoalNames()
Returns:

getGoalNames

public java.util.Set getGoalNames(Project project)
                           throws MavenException
Warning - this completely scrogs the default mapper. Only use this before System.exit! (currently used by maven -u).

Returns:
Throws:
MavenException

installPlugin

public void installPlugin(java.io.File file,
                          Project parentProject)
                   throws MavenException
Throws:
MavenException

installPlugin

public void installPlugin(java.io.File file,
                          Project parentProject,
                          boolean cache)
                   throws MavenException
Load and install a plugin.

Parameters:
file - the file to install. Must be a plugin jar
parentProject - the project to load the installed plugin into
Throws:
MavenException

uninstallPlugin

public void uninstallPlugin(java.lang.String artifactId)
                     throws java.io.IOException
Throws:
java.io.IOException

getPluginContext

public MavenJellyContext getPluginContext(java.lang.String id)
                                   throws MavenException,
                                          UnknownPluginException
Parameters:
id -
Returns:
Throws:
UnknownPluginException
MavenException

getGoalDescription

public java.lang.String getGoalDescription(java.lang.String goalName)

addDelayedPops

public void addDelayedPops(java.util.Set set)

getPluginProjectFromGoal

public Project getPluginProjectFromGoal(java.lang.String goal)
                                 throws MavenException
Throws:
MavenException

getPluginList

public java.util.Collection getPluginList()


Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.