public class MojoExecutor
extends java.lang.Object
executeMojo(
plugin(
groupId("org.apache.maven.plugins"),
artifactId("maven-dependency-plugin"),
version("2.0")
),
goal("copy-dependencies"),
configuration(
element(name("outputDirectory"), "${project.build.directory}/foo")
),
executionEnvironment(
project,
session,
pluginManager
)
);
| Modifier and Type | Class and Description |
|---|---|
static class |
MojoExecutor.Attribute
Attribute wrapper class
|
static class |
MojoExecutor.Attributes
Collection of attributes wrapper class
|
static class |
MojoExecutor.Element
Element wrapper class for configuration elements
|
static class |
MojoExecutor.ExecutionEnvironment
Collects Maven execution information
|
| Constructor and Description |
|---|
MojoExecutor() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
artifactId(java.lang.String artifactId)
Wraps the artifact id string in a more readable format
|
static MojoExecutor.Attribute |
attribute(java.lang.String name,
java.lang.String value)
Constructs the attribute
|
static MojoExecutor.Attributes |
attributes(MojoExecutor.Attribute... attributes)
Constructs the attributes wrapper
|
static org.codehaus.plexus.util.xml.Xpp3Dom |
configuration(MojoExecutor.Element... elements)
Builds the configuration for the goal using Elements
|
static java.util.List<org.apache.maven.model.Dependency> |
dependencies(org.apache.maven.model.Dependency... dependencies)
Creates a list of dependencies.
|
static org.apache.maven.model.Dependency |
dependency(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
Defines a dependency
|
static MojoExecutor.Element |
element(java.lang.String name,
MojoExecutor.Attribute attribute,
MojoExecutor.Element... elements)
Constructs the element containing child elements and only attribute
|
static MojoExecutor.Element |
element(java.lang.String name,
MojoExecutor.Attributes attributes,
MojoExecutor.Element... elements)
Constructs the element containing child elements and attributes
|
static MojoExecutor.Element |
element(java.lang.String name,
MojoExecutor.Element... elements)
Constructs the element containing child elements
|
static MojoExecutor.Element |
element(java.lang.String name,
java.lang.String value)
Constructs the element with a textual body
|
static MojoExecutor.Element |
element(java.lang.String name,
java.lang.String value,
MojoExecutor.Attribute attribute)
Constructs the element with a textual body and only attribute
|
static MojoExecutor.Element |
element(java.lang.String name,
java.lang.String value,
MojoExecutor.Attributes attributes)
Constructs the element with a textual body and attributes
|
static void |
executeMojo(org.apache.maven.model.Plugin plugin,
java.lang.String goal,
org.codehaus.plexus.util.xml.Xpp3Dom configuration,
MojoExecutor.ExecutionEnvironment env)
Entry point for executing a mojo
|
static MojoExecutor.ExecutionEnvironment |
executionEnvironment(org.apache.maven.project.MavenProject mavenProject,
org.apache.maven.execution.MavenSession mavenSession,
org.apache.maven.plugin.BuildPluginManager pluginManager)
Constructs the
MojoExecutor.ExecutionEnvironment instance fluently |
static MojoExecutor.ExecutionEnvironment |
executionEnvironment(org.apache.maven.execution.MavenSession mavenSession,
org.apache.maven.plugin.BuildPluginManager pluginManager)
Constructs the
MojoExecutor.ExecutionEnvironment instance fluently |
static java.lang.String |
goal(java.lang.String goal)
Wraps the goal string in a more readable format
|
static java.lang.String |
groupId(java.lang.String groupId)
Wraps the group id string in a more readable format
|
static java.lang.String |
name(java.lang.String name)
Wraps the element name string in a more readable format
|
static org.apache.maven.model.Plugin |
plugin(java.lang.String groupId,
java.lang.String artifactId)
Defines the plugin without its version or dependencies.
|
static org.apache.maven.model.Plugin |
plugin(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
Defines a plugin without dependencies.
|
static org.apache.maven.model.Plugin |
plugin(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.util.List<org.apache.maven.model.Dependency> dependencies)
Defines a plugin.
|
static java.lang.String |
version(java.lang.String version)
Wraps the version string in a more readable format
|
public static void executeMojo(org.apache.maven.model.Plugin plugin,
java.lang.String goal,
org.codehaus.plexus.util.xml.Xpp3Dom configuration,
MojoExecutor.ExecutionEnvironment env)
throws org.apache.maven.plugin.MojoExecutionException
plugin - The plugin to executegoal - The goal to executeconfiguration - The execution configurationenv - The execution environmentorg.apache.maven.plugin.MojoExecutionException - If there are any exceptions locating or executing the mojopublic static MojoExecutor.ExecutionEnvironment executionEnvironment(org.apache.maven.project.MavenProject mavenProject, org.apache.maven.execution.MavenSession mavenSession, org.apache.maven.plugin.BuildPluginManager pluginManager)
MojoExecutor.ExecutionEnvironment instance fluentlymavenProject - The current Maven projectmavenSession - The current Maven sessionpluginManager - The Build plugin managerjava.lang.NullPointerException - if mavenProject, mavenSession or pluginManager
are nullpublic static MojoExecutor.ExecutionEnvironment executionEnvironment(org.apache.maven.execution.MavenSession mavenSession, org.apache.maven.plugin.BuildPluginManager pluginManager)
MojoExecutor.ExecutionEnvironment instance fluentlymavenSession - The current Maven sessionpluginManager - The Build plugin managerjava.lang.NullPointerException - if mavenProject, mavenSession or pluginManager
are nullpublic static org.codehaus.plexus.util.xml.Xpp3Dom configuration(MojoExecutor.Element... elements)
elements - A list of elements for the configuration sectionpublic static org.apache.maven.model.Plugin plugin(java.lang.String groupId,
java.lang.String artifactId)
groupId - The group idartifactId - The artifact idpublic static org.apache.maven.model.Plugin plugin(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
groupId - The group idartifactId - The artifact idversion - The plugin versionpublic static org.apache.maven.model.Plugin plugin(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.util.List<org.apache.maven.model.Dependency> dependencies)
groupId - The group idartifactId - The artifact idversion - The plugin versiondependencies - The plugin dependenciespublic static java.lang.String groupId(java.lang.String groupId)
groupId - The valuepublic static java.lang.String artifactId(java.lang.String artifactId)
artifactId - The valuepublic static java.lang.String version(java.lang.String version)
version - The valuepublic static java.util.List<org.apache.maven.model.Dependency> dependencies(org.apache.maven.model.Dependency... dependencies)
dependencies - the dependenciespublic static org.apache.maven.model.Dependency dependency(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
groupId - The group idartifactId - The artifact idversion - The plugin versionpublic static java.lang.String goal(java.lang.String goal)
goal - The valuepublic static java.lang.String name(java.lang.String name)
name - The valuepublic static MojoExecutor.Element element(java.lang.String name, java.lang.String value)
name - The element namevalue - The element text valuepublic static MojoExecutor.Element element(java.lang.String name, java.lang.String value, MojoExecutor.Attributes attributes)
name - The element namevalue - The element text valueattributes - The element attributespublic static MojoExecutor.Element element(java.lang.String name, java.lang.String value, MojoExecutor.Attribute attribute)
name - The element namevalue - The element text valueattribute - The element attributepublic static MojoExecutor.Element element(java.lang.String name, MojoExecutor.Element... elements)
name - The element nameelements - The child elementspublic static MojoExecutor.Element element(java.lang.String name, MojoExecutor.Attributes attributes, MojoExecutor.Element... elements)
name - The element nameattributes - The element attributeselements - The child elementspublic static MojoExecutor.Element element(java.lang.String name, MojoExecutor.Attribute attribute, MojoExecutor.Element... elements)
name - The element nameattribute - The element attributeelements - The child elementspublic static MojoExecutor.Attributes attributes(MojoExecutor.Attribute... attributes)
attributes - The attributespublic static MojoExecutor.Attribute attribute(java.lang.String name, java.lang.String value)
name - The attribute namevalue - The attribute valueCopyright © 2008-2019. All Rights Reserved.