Package org.apache.maven.plugins.antrun
Class AntRunMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.antrun.AntRunMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="run",
threadSafe=true,
requiresDependencyResolution=TEST)
public class AntRunMojo
extends org.apache.maven.plugin.AbstractMojo
Maven AntRun Mojo.
This plugin provides the capability of calling Ant tasks from a POM by running the nested Ant tasks inside the <target/> parameter. It is encouraged to move the actual tasks to a separate build.xml file and call that file with an <ant/> task.
- Author:
- Kenney Westerhof, Vincent Siveton
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path to The XML file containing the definition of the Maven tasks.static final StringThe default target name.static final StringThe refid used to store the Maven project object in the Ant build.static final StringThe refid used to store an object of typeMavenAntRunProjectcontaining the Maven project object in the Ant build.static final StringThe refid used to store the Maven project object in the Ant build.protected org.apache.maven.artifact.repository.ArtifactRepositoryThe local Maven repositorystatic final StringThe prefix of all refid used by the plugin.static final StringThe URI which defines the built in Ant tasksstatic final StringThe default encoding to use for the generated Ant build.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyProperties(org.apache.maven.project.MavenProject mavenProject, org.apache.tools.ant.Project antProject) Copy properties from the Maven project to the Ant project.voidcopyProperties(org.apache.tools.ant.Project antProject, org.apache.maven.project.MavenProject mavenProject) Copy properties from the Ant project to the Maven project.voidexecute()voidinitMavenTasks(org.apache.tools.ant.Project antProject) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
MAVEN_REFID_PREFIX
The prefix of all refid used by the plugin.- See Also:
-
DEFAULT_MAVEN_PROJECT_REFID
The refid used to store the Maven project object in the Ant build. If this reference is retrieved in a custom task, note that this will be a clone of the Maven project, and not the project itself, when the task is called through ananttask.- See Also:
-
DEFAULT_MAVEN_PROJECT_REF_REFID
The refid used to store an object of typeMavenAntRunProjectcontaining the Maven project object in the Ant build. This is useful when a custom task needs to change the Maven project, because, unlikeDEFAULT_MAVEN_PROJECT_REFID, this makes sure to reference the same instance of the Maven project in all cases.- See Also:
-
DEFAULT_MAVEN_PROJECT_HELPER_REFID
The refid used to store the Maven project object in the Ant build.- See Also:
-
DEFAULT_ANT_TARGET_NAME
The default target name.- See Also:
-
UTF_8
The default encoding to use for the generated Ant build.- See Also:
-
ANTLIB
The path to The XML file containing the definition of the Maven tasks.- See Also:
-
TASK_URI
The URI which defines the built in Ant tasks- See Also:
-
localRepository
@Parameter(property="localRepository", readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepositoryThe local Maven repository
-
-
Constructor Details
-
AntRunMojo
@Inject public AntRunMojo(org.apache.maven.project.MavenProjectHelper projectHelper)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
copyProperties
public void copyProperties(org.apache.maven.project.MavenProject mavenProject, org.apache.tools.ant.Project antProject) Copy properties from the Maven project to the Ant project.- Parameters:
mavenProject-MavenProjectantProject-Project
-
copyProperties
public void copyProperties(org.apache.tools.ant.Project antProject, org.apache.maven.project.MavenProject mavenProject) Copy properties from the Ant project to the Maven project.- Parameters:
antProject- not nullmavenProject- not null- Since:
- 1.7
-
initMavenTasks
public void initMavenTasks(org.apache.tools.ant.Project antProject) - Parameters:
antProject-Project
-