public class InstallPluginsMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private org.codehaus.plexus.archiver.manager.ArchiverManager |
archiverManager
Used to configure and retrieve an appropriate tool for extracting each resolved plugin dependency.
|
private java.util.Collection |
artifacts
The list of resolved dependencies from the current project.
|
private java.io.File |
eclipseDir
This is the installed base directory of the Eclipse instance you want to modify.
|
private org.codehaus.plexus.components.interactivity.InputHandler |
inputHandler
Input handler, needed for comand line handling.
|
private org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
The location of the Maven local repository, from which to install resolved dependency plugins.
|
private org.apache.maven.shared.osgi.Maven2OsgiConverter |
maven2OsgiConverter |
private boolean |
overwrite
Determines whether this mojo leaves existing installed plugins as-is, or overwrites them.
|
private java.lang.String |
pluginDependencyTypes
Comma-delimited list of dependency <type/> values which will be installed in the eclipse instance's plugins
directory.
|
private java.io.File |
pluginsDir |
private org.apache.maven.project.MavenProjectBuilder |
projectBuilder
Used to retrieve the project metadata (POM) associated with each plugin dependency, to help determine whether
that plugin should be installed as a jar, or expanded into a directory.
|
static java.lang.String |
PROP_UNPACK_PLUGIN
Set this property in a plugin POM's <properties/> section to determine whether that plugin should be
expanded during installation, or left as a jar file.
|
| Modifier | Constructor and Description |
|---|---|
|
InstallPluginsMojo() |
protected |
InstallPluginsMojo(java.io.File eclipseDir,
boolean overwrite,
java.util.List dependencyArtifacts,
java.lang.String pluginDependencyTypes,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
org.apache.maven.project.MavenProjectBuilder projectBuilder,
org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager,
org.codehaus.plexus.components.interactivity.InputHandler inputHandler,
org.apache.maven.plugin.logging.Log log) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Traverse the list of resolved dependency artifacts.
|
private java.lang.String |
formatEclipsePluginName(org.apache.maven.artifact.Artifact artifact)
Format the artifact information into an Eclipse-friendly plug-in name.
|
private void |
install(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.project.MavenProject project)
Install the plugin into the eclipse instance's /plugins directory
|
private void |
performFileOperations(boolean installAsJar,
org.apache.maven.artifact.Artifact artifact,
java.io.File pluginFile,
java.io.File pluginDir) |
public static final java.lang.String PROP_UNPACK_PLUGIN
private java.io.File eclipseDir
private boolean overwrite
private java.util.Collection artifacts
private java.lang.String pluginDependencyTypes
private org.apache.maven.artifact.repository.ArtifactRepository localRepository
private org.apache.maven.project.MavenProjectBuilder projectBuilder
private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
private org.codehaus.plexus.components.interactivity.InputHandler inputHandler
private java.io.File pluginsDir
private org.apache.maven.shared.osgi.Maven2OsgiConverter maven2OsgiConverter
public InstallPluginsMojo()
protected InstallPluginsMojo(java.io.File eclipseDir,
boolean overwrite,
java.util.List dependencyArtifacts,
java.lang.String pluginDependencyTypes,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
org.apache.maven.project.MavenProjectBuilder projectBuilder,
org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager,
org.codehaus.plexus.components.interactivity.InputHandler inputHandler,
org.apache.maven.plugin.logging.Log log)
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate void install(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.project.MavenProject project)
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
Install the plugin into the eclipse instance's /plugins directory
Warn whenever a plugin will overwrite an existing file or directory, and emit an INFO message whenever a plugin installation is skipped because of an existing file and overwrite == false.
artifact - The plugin dependency as it has been resolved.project - The project metadata for the accompanying plugin-dependency artifact, used to determine whether to
install as a jar or as a directoryorg.apache.maven.plugin.MojoExecutionException - In the event the plugin should be extracted but cannot, or the file copy fails (in
the event it should not be extracted)org.apache.maven.plugin.MojoFailureException - In the event that the plugins target directory (inside the Eclipse instance
directory) does not exist, or is not a directory.private void performFileOperations(boolean installAsJar,
org.apache.maven.artifact.Artifact artifact,
java.io.File pluginFile,
java.io.File pluginDir)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate java.lang.String formatEclipsePluginName(org.apache.maven.artifact.Artifact artifact)
Format the artifact information into an Eclipse-friendly plug-in name. Delegates to maven2OsgiConverter to obtain bundle symbolic name and version.