public class PluginManager extends AbstractMavenComponent
PluginManager deals with all aspects of a plugins lifecycle.
This is not thread safe.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
PluginManager(MavenSession session)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
(package private) JellyScriptHousing |
loadPluginHousing(java.lang.String name,
java.io.File pluginDir) |
(package private) void |
mapArtifactIdToPluginHousing(java.lang.String artifactId,
JellyScriptHousing housing) |
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
|
(package private) java.util.List |
readMavenXml(Project project,
GoalToJellyScriptHousingMapper mapper) |
(package private) void |
runScript(JellyScriptHousing jellyScriptHousing,
MavenJellyContext context) |
(package private) MavenJellyContext |
setupBaseContext(Project project) |
void |
uninstallPlugin(java.lang.String artifactId) |
(package private) java.io.File |
unpackPlugin(java.lang.String pluginName,
java.io.File jarFile,
boolean cache)
Unpack the plugin.
|
getMessage, getMessage, getProject, setProjectpublic static final java.lang.String GLOBAL_SESSION_KEY
com.werken.werkz.Session in the parent scope context.public static final java.lang.String PLUGIN_MANAGER
public static final java.lang.String PLUGIN_HOUSING
public static final java.lang.String GOAL_MAPPER
public static final java.lang.String BASE_CONTEXT
public PluginManager(MavenSession session)
session - The MavenSession this plugin manager will use
until Maven shuts down.public void initialize()
throws java.io.IOException,
MavenException
java.io.IOExceptionMavenExceptionJellyScriptHousing loadPluginHousing(java.lang.String name, java.io.File pluginDir) throws java.io.IOException
java.io.IOExceptionvoid mapArtifactIdToPluginHousing(java.lang.String artifactId,
JellyScriptHousing housing)
public void processDependencies(Project project) throws java.net.MalformedURLException, java.lang.Exception
java.net.MalformedURLException - if a file can't be converted to a URL.java.lang.Exception - for any other issue. FIXMEjava.util.List readMavenXml(Project project, GoalToJellyScriptHousingMapper mapper) throws MavenException
MavenExceptionMavenJellyContext setupBaseContext(Project project)
public void attainGoals(Project project, java.util.List goals) throws java.lang.Exception
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.public void cleanupAttainGoal(java.util.Set pluginSet)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Set prepAttainGoal(java.lang.String goalName,
MavenJellyContext baseContext,
GoalToJellyScriptHousingMapper goalMapper)
throws java.lang.Exception
goalName - the goalbaseContext - the base context to attain injava.lang.Exceptionpublic java.util.Set getGoalNames()
public java.util.Set getGoalNames(Project project) throws MavenException
MavenExceptionpublic void installPlugin(java.io.File file,
Project parentProject)
throws MavenException
MavenExceptionpublic void installPlugin(java.io.File file,
Project parentProject,
boolean cache)
throws MavenException
file - the file to install. Must be a plugin jarparentProject - the project to load the installed plugin intoMavenExceptionpublic void uninstallPlugin(java.lang.String artifactId)
throws java.io.IOException
java.io.IOExceptionpublic MavenJellyContext getPluginContext(java.lang.String id) throws MavenException, UnknownPluginException
id - UnknownPluginExceptionMavenExceptionpublic java.lang.String getGoalDescription(java.lang.String goalName)
public void addDelayedPops(java.util.Set set)
java.io.File unpackPlugin(java.lang.String pluginName,
java.io.File jarFile,
boolean cache)
throws MavenException
MavenException - if there was a problem unpackingvoid runScript(JellyScriptHousing jellyScriptHousing, MavenJellyContext context) throws java.lang.Exception
context - java.lang.Exceptionpublic Project getPluginProjectFromGoal(java.lang.String goal) throws MavenException
MavenExceptionpublic java.util.Collection getPluginList()
Copyright © 2001-2013 Apache Software Foundation. All Rights Reserved.