Groovy Documentation

## org.codehaus.groovy.grails.resolve
[Groovy] Class PluginInstallEngine

    java.lang.Object
      org.codehaus.groovy.grails.resolve.PluginInstallEngine

    class PluginInstallEngine

Manages the installation and uninstallation of plugins from a Grails project.

Authors:
  Graeme Rocher

Since:
  1.3

Field Summary
`protected java.lang.Object` | `ant`
`protected java.lang.Object` | `applicationPluginsLocation`
`protected java.lang.Object` | `globalPluginsLocation`
`protected Metadata` | `metadata`
`protected PluginBuildSettings` | `pluginSettings`
`protected PluginResolveEngine` | `resolveEngine`
`protected BuildSettings` | `settings`

Property Summary
`static java.lang.Object` | `CORE_PLUGINS`
`CommandLineHelper` | `commandLineHelper`
`groovy.lang.Closure` | `errorHandler`
`groovy.lang.Closure` | `eventHandler`
`java.util.List` | `installedPlugins` plugins that were installed in the last execution of installPlugin
`boolean` | `isInteractive`
`java.lang.Object` | `pluginDirVariableStore`
`groovy.lang.Closure` | `pluginScriptRunner`
`groovy.lang.Closure` | `postInstallEvent`
`groovy.lang.Closure` | `postUninstallEvent`

Constructor Summary
`PluginInstallEngine(java.lang.Object settings)`
`PluginInstallEngine(java.lang.Object settings, java.lang.Object pbs)`
`PluginInstallEngine(java.lang.Object settings, java.lang.Object pbs, Metadata md)`
`PluginInstallEngine(java.lang.Object settings, java.lang.Object pbs, Metadata md, groovy.util.AntBuilder ant)`

Method Summary
`protected java.lang.Object` | `addJarsToRootLoader(java.util.Collection pluginJars)`
`protected void` | `assertNoExistingInlinePlugin(java.lang.String name)`
`protected boolean` | `checkExistingPluginInstall(java.lang.String name, java.lang.Object version)` Checks an existing plugin path to install and returns true if the installation should be aborted or false if it should continue
`protected void` | `checkPluginsToUninstall(java.util.List pluginDeps)`
`protected void` | `displayNewScripts(java.lang.Object pluginName, java.lang.Object installPath)`
`protected java.util.List` | `findMissingOrUpgradePlugins(java.util.List pluginDeps)`
`void` | `installPlugin(java.lang.String name, java.lang.String version = null, boolean globalInstall = false)` Installs a plugin for the given name and optional version
`void` | `installPlugin(java.io.File zipFile, boolean globalInstall = false, boolean overwrite = false)` Installs a plugin from the given ZIP file
`void` | `installPlugin(java.net.URL zipURL, boolean globalInstall = false)` Installs a plugin from the given URL
`protected void` | `installPluginZipInternal(java.lang.String name, java.lang.String version, java.io.File pluginZip, boolean globalInstall = false, boolean overwrite = false)`
`void` | `installPlugins(java.util.List plugins)` Installs a list of plugins
`boolean` | `isNotInlinePluginLocation(java.io.File pluginDir)` Check to see if the plugin directory is in plugins home.
`protected java.lang.Object` | `postInstall(java.lang.String pluginInstallPath)`
`protected java.lang.Object` | `postUninstall()`
`protected java.util.Map` | `processPluginDependencies(java.lang.String pluginName, groovy.util.slurpersupport.GPathResult pluginXml)`
`java.util.List` | `readMetadataFromZip(java.lang.String zipLocation)` Reads plugin metadata from a plugin zip file and returns a list containing the plugin name, version and XML metadata.
`protected java.lang.Object` | `readPluginXmlMetadata(java.lang.String pluginDirName)`
`void` | `registerPluginWithMetadata(java.lang.String pluginName, java.lang.Object pluginVersion)` Registers a plugin name and version as installed according to the plugin metadata
`void` | `resolvePluginDependencies()` This method will resolve the current dependencies and install any missing plugins or upgrades and remove any plugins that aren't present in the metadata but are installed
`protected void` | `resolvePluginJarDependencies(java.lang.Object pluginName, java.lang.Object pluginInstallPath)`
`void` | `uninstallPlugin(java.lang.String name, java.lang.String version = null)` Uninstalls a plugin for the given name and optional version

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### ant

    protected java.lang.Object ant

### applicationPluginsLocation

    protected java.lang.Object applicationPluginsLocation

### globalPluginsLocation

    protected java.lang.Object globalPluginsLocation

### metadata

    protected Metadata metadata

### pluginSettings

    protected PluginBuildSettings pluginSettings

### resolveEngine

    protected PluginResolveEngine resolveEngine

### settings

    protected BuildSettings settings

Property Detail

### CORE_PLUGINS

    static final java.lang.Object CORE_PLUGINS

### commandLineHelper

    CommandLineHelper commandLineHelper

### errorHandler

    groovy.lang.Closure errorHandler

### eventHandler

    groovy.lang.Closure eventHandler

### installedPlugins

    java.util.List installedPlugins

  plugins that were installed in the last execution of installPlugin

### isInteractive

    boolean isInteractive

### pluginDirVariableStore

    java.lang.Object pluginDirVariableStore

### pluginScriptRunner

    groovy.lang.Closure pluginScriptRunner

### postInstallEvent

    groovy.lang.Closure postInstallEvent

### postUninstallEvent

    groovy.lang.Closure postUninstallEvent

Constructor Detail

### PluginInstallEngine

    PluginInstallEngine(java.lang.Object settings)

### PluginInstallEngine

    PluginInstallEngine(java.lang.Object settings, java.lang.Object pbs)

### PluginInstallEngine

    PluginInstallEngine(java.lang.Object settings, java.lang.Object pbs, Metadata md)

### PluginInstallEngine

    PluginInstallEngine(java.lang.Object settings, java.lang.Object pbs, Metadata md, groovy.util.AntBuilder ant)

Method Detail

### addJarsToRootLoader

    protected java.lang.Object addJarsToRootLoader(java.util.Collection pluginJars)

### assertNoExistingInlinePlugin

    protected void assertNoExistingInlinePlugin(java.lang.String name)

### checkExistingPluginInstall

    protected boolean checkExistingPluginInstall(java.lang.String name, java.lang.Object version)

  Checks an existing plugin path to install and returns true if the installation should be aborted or false if it should continue If an error occurs the errorHandler is invoked.
  Parameters:
    `name` - The plugin name
    `version` - The plugin version
  Returns:
    True if the installation should be aborted

### checkPluginsToUninstall

    protected void checkPluginsToUninstall(java.util.List pluginDeps)

### displayNewScripts

    protected void displayNewScripts(java.lang.Object pluginName, java.lang.Object installPath)

### findMissingOrUpgradePlugins

    protected java.util.List findMissingOrUpgradePlugins(java.util.List pluginDeps)

### installPlugin

    void installPlugin(java.lang.String name, java.lang.String version = null, boolean globalInstall = false)

  Installs a plugin for the given name and optional version
  Parameters:
    `name` - The plugin name
    `version` - The plugin version (optional)
    `globalInstall` - Whether to install globally or not (optional)

### installPlugin

    void installPlugin(java.io.File zipFile, boolean globalInstall = false, boolean overwrite = false)

  Installs a plugin from the given ZIP file
  Parameters:
    `zipFile` - The plugin zip file
    `globalInstall` - Whether it is a global install or not (optional)

### installPlugin

    void installPlugin(java.net.URL zipURL, boolean globalInstall = false)

  Installs a plugin from the given URL
  Parameters:
    `zipURL` - The zip URL
    `globalInstall` - Whether it is a global install or not (optional)

### installPluginZipInternal

    protected void installPluginZipInternal(java.lang.String name, java.lang.String version, java.io.File pluginZip, boolean globalInstall = false, boolean overwrite = false)

### installPlugins

    void installPlugins(java.util.List plugins)

  Installs a list of plugins
  Parameters:
    `params` - A list of plugins defined each by a ModuleRevisionId

### isNotInlinePluginLocation

    boolean isNotInlinePluginLocation(java.io.File pluginDir)

  Check to see if the plugin directory is in plugins home.

### postInstall

    protected java.lang.Object postInstall(java.lang.String pluginInstallPath)

### postUninstall

    protected java.lang.Object postUninstall()

### processPluginDependencies

    protected java.util.Map processPluginDependencies(java.lang.String pluginName, groovy.util.slurpersupport.GPathResult pluginXml)

### readMetadataFromZip

    java.util.List readMetadataFromZip(java.lang.String zipLocation)

  Reads plugin metadata from a plugin zip file and returns a list containing the plugin name, version and XML metadata. Designed for use with Groovy's multiple assignment operator
  Parameters:
    `zipLocation` - The zip location
  Returns:
    A list

### readPluginXmlMetadata

    protected java.lang.Object readPluginXmlMetadata(java.lang.String pluginDirName)

### registerPluginWithMetadata

    void registerPluginWithMetadata(java.lang.String pluginName, java.lang.Object pluginVersion)

  Registers a plugin name and version as installed according to the plugin metadata
  Parameters:
    `pluginName` - the name of the plugin
    `pluginVersion` - the version of the plugin

### resolvePluginDependencies

    void resolvePluginDependencies()

  This method will resolve the current dependencies and install any missing plugins or upgrades and remove any plugins that aren't present in the metadata but are installed

### resolvePluginJarDependencies

    protected void resolvePluginJarDependencies(java.lang.Object pluginName, java.lang.Object pluginInstallPath)

### uninstallPlugin

    void uninstallPlugin(java.lang.String name, java.lang.String version = null)

  Uninstalls a plugin for the given name and optional version
  Parameters:
    `name` - The plugin name
    `version` - The version

Groovy Documentation