public abstract class AbstractWrapperForBuiltinMojo<CustomResource extends org.apache.maven.model.Resource>
extends org.apache.maven.plugin.AbstractMojo
This goal is just a wrapper to launch a goal from a builtin Maven plugin
(such as org.apache.maven.plugins:maven-dependency-plugin) with a
configuration bound to the lifecycle but without triggering a parallel
lifecycle.
This configuration will be injected from the Plexus 'components.xml' file.
NB: The Maven 2 doclet annotations must be used to inject properly the configuration.
Duplicate this template code to create a new wrapped goal (all << >> must be replaced).
Original goal : <<groupId>>:<<artifactId>>:<<goal-name>>
Associated Plexus 'components.xml' sections (first section is shared) :
<component> <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> <role-hint><<packaging-name>></role-hint> <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping </implementation> <configuration> <lifecycles> <lifecycle> <id>default</id> <phases> <generate-sources> << fr.fastconnect.factory.tibco.bw.maven:bw-maven-plugin:resolve-bw-dependencies >> </generate-sources> </phases> </lifecycle> </lifecycles> </configuration> </component> <component> <role>org.apache.maven.plugin.Mojo</role> <role-hint><<default-new-goal-name>></role-hint> <implementation><<fr.fastconnect.factory.tibco.bw.maven.builtin.AbstractWrapperForBuiltinMojo>></implementation> <configuration> <groupId><<org.apache.maven.plugins>></groupId> <artifactId><<maven-dependency-plugin>></artifactId> <version><<2.8>></version> <goal><<resolve>></goal> << <outputFile>${project.build.directory}/resolved</outputFile> >> << <includeTypes>projlib,jar</includeTypes> >> </configuration> <requirements> <requirement> <role>org.apache.maven.plugin.BuildPluginManager</role> <role-hint /> <field-name>pluginManager</field-name> </requirement> </requirements> </component>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
artifactId |
protected java.util.Properties |
configuration
The actual Mojo configuration found in the Plexus 'components.xml' file
|
protected java.lang.String |
goal |
protected java.lang.String |
groupId |
protected org.apache.maven.plugin.BuildPluginManager |
pluginManager
The Build Plugin Manager (this one is Java5 annotation style).
|
protected org.apache.maven.project.MavenProject |
project
The project currently being build.
|
protected java.util.Properties |
resources
Optional resources parameter do define includes/excludes filesets
|
protected org.apache.maven.execution.MavenSession |
session
The current Maven session.
|
protected java.lang.String |
version |
Constructor and Description |
---|
AbstractWrapperForBuiltinMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute()
This method will call the actual builtin goal from the Mojo specified in
Plexus 'components.xml'.
|
protected java.util.List<org.twdata.maven.mojoexecutor.MojoExecutor.Element> |
generateCustomElements(CustomResource resource)
Children classes can use a descendant of
Resource (because of the
|
protected abstract java.lang.String |
getArtifactId() |
protected abstract java.util.Properties |
getConfiguration() |
protected org.twdata.maven.mojoexecutor.MojoExecutor.ExecutionEnvironment |
getEnvironment() |
protected abstract java.lang.String |
getGoal() |
protected abstract java.lang.String |
getGroupId() |
protected abstract org.apache.maven.plugin.BuildPluginManager |
getPluginManager() |
protected abstract org.apache.maven.project.MavenProject |
getProject() |
protected abstract java.util.List<CustomResource> |
getResources() |
protected abstract org.apache.maven.execution.MavenSession |
getSession() |
protected abstract java.lang.String |
getVersion() |
protected java.lang.String groupId
protected java.lang.String artifactId
protected java.lang.String version
protected java.lang.String goal
protected org.apache.maven.project.MavenProject project
protected org.apache.maven.execution.MavenSession session
@Component(role=org.apache.maven.plugin.BuildPluginManager.class) protected org.apache.maven.plugin.BuildPluginManager pluginManager
protected java.util.Properties configuration
protected java.util.Properties resources
protected abstract java.lang.String getGroupId()
protected abstract java.lang.String getArtifactId()
protected abstract java.lang.String getVersion()
protected abstract java.lang.String getGoal()
protected abstract org.apache.maven.project.MavenProject getProject()
protected abstract org.apache.maven.execution.MavenSession getSession()
protected abstract org.apache.maven.plugin.BuildPluginManager getPluginManager()
protected abstract java.util.Properties getConfiguration()
protected abstract java.util.List<CustomResource> getResources()
protected org.twdata.maven.mojoexecutor.MojoExecutor.ExecutionEnvironment getEnvironment()
protected java.util.List<org.twdata.maven.mojoexecutor.MojoExecutor.Element> generateCustomElements(CustomResource resource)
Resource
(because of the
extends Resource> declaration).
If so, the children classes are responsible for coding the additional
mappings from Java objects to MojoExecutor.Element
.resource
- public void execute() throws org.apache.maven.plugin.MojoExecutionException
MojoExecutor
is used to perform the call natively.org.apache.maven.plugin.MojoExecutionException