public abstract class AbstractExecMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private boolean |
addOutputToClasspath
Add project output directory to classpath.
|
private boolean |
addResourcesToClasspath
Add project resource directories to classpath.
|
private org.apache.maven.artifact.factory.ArtifactFactory |
artifactFactory |
private org.apache.maven.artifact.resolver.ArtifactResolver |
artifactResolver |
protected java.lang.String |
classpathScope
Defines the scope of the classpath passed to the plugin.
|
private java.lang.String |
commandlineArgs
Arguments separated by space for the executed program.
|
protected ExecutableDependency |
executableDependency
If provided the ExecutableDependency identifies which of the plugin dependencies contains the executable class.
|
private org.apache.maven.artifact.repository.ArtifactRepository |
localRepository |
private org.apache.maven.artifact.metadata.ArtifactMetadataSource |
metadataSource |
private java.util.List<org.apache.maven.artifact.Artifact> |
pluginDependencies |
protected org.apache.maven.project.MavenProject |
project
The enclosing project.
|
private org.apache.maven.project.MavenProjectBuilder |
projectBuilder |
private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> |
remoteRepositories |
private boolean |
skip
Skip the execution.
|
private java.io.File |
sourceRoot
This folder is added to the list of those folders containing source to be compiled.
|
private java.io.File |
testSourceRoot
This folder is added to the list of those folders containing source to be compiled for testing.
|
| Constructor and Description |
|---|
AbstractExecMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
collectProjectArtifactsAndClasspath(java.util.List<org.apache.maven.artifact.Artifact> artifacts,
java.util.List<java.io.File> theClasspathFiles)
Collects the project artifacts in the specified List and the project specific classpath (build output and build
test output) Files in the specified List, depending on the plugin classpathScope value.
|
protected org.apache.maven.artifact.Artifact |
findExecutableArtifact()
Examine the plugin dependencies to find the executable artifact.
|
protected boolean |
hasCommandlineArgs() |
protected boolean |
isSkip()
Check if the execution should be skipped
|
protected java.lang.String[] |
parseCommandlineArgs()
Parses the argument string given by the user.
|
protected void |
registerSourceRoots()
Register compile and compile tests source roots if necessary
|
getLog, getPluginContext, setLog, setPluginContext@Parameter(defaultValue="${project}",
readonly=true)
protected org.apache.maven.project.MavenProject project
@Component private org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
@Component private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
@Component private org.apache.maven.project.MavenProjectBuilder projectBuilder
@Component private org.apache.maven.artifact.metadata.ArtifactMetadataSource metadataSource
@Parameter(readonly=true,
required=true,
defaultValue="${localRepository}")
private org.apache.maven.artifact.repository.ArtifactRepository localRepository
@Parameter(readonly=true,
required=true,
defaultValue="${project.remoteArtifactRepositories}")
private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
@Parameter(readonly=true,
defaultValue="${plugin.artifacts}")
private java.util.List<org.apache.maven.artifact.Artifact> pluginDependencies
@Parameter protected ExecutableDependency executableDependency
If includeProjectDependencies is set to true, all of the project dependencies will be included on
the executable's classpath. Whether a particular project dependency is a dependency of the identified
ExecutableDependency will be irrelevant to its inclusion in the classpath.
@Parameter(property="sourceRoot") private java.io.File sourceRoot
@Parameter(property="testSourceRoot") private java.io.File testSourceRoot
@Parameter(property="exec.args") private java.lang.String commandlineArgs
@Parameter(property="exec.classpathScope",
defaultValue="runtime")
protected java.lang.String classpathScope
@Parameter(property="exec.skip",
defaultValue="false",
alias="skip")
private boolean skip
skip has been changed into
exec.skip.@Parameter(property="addResourcesToClasspath",
defaultValue="false")
private boolean addResourcesToClasspath
@Parameter(property="addOutputToClasspath",
defaultValue="true")
private boolean addOutputToClasspath
true.protected void collectProjectArtifactsAndClasspath(java.util.List<org.apache.maven.artifact.Artifact> artifacts,
java.util.List<java.io.File> theClasspathFiles)
artifacts - the list where to collect the scope specific artifactstheClasspathFiles - the list where to collect the scope specific output directoriesprotected java.lang.String[] parseCommandlineArgs()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - for wrong formatted argumentsprotected boolean hasCommandlineArgs()
protected void registerSourceRoots()
protected boolean isSkip()
protected org.apache.maven.artifact.Artifact findExecutableArtifact()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - if no executable artifact was found