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
Fields Modifier and Type Field Description static String
ANTLIB
The path to The XML file containing the definition of the Maven tasks.static String
DEFAULT_ANT_TARGET_NAME
The default target name.static String
DEFAULT_MAVEN_PROJECT_HELPER_REFID
The refid used to store the Maven project object in the Ant build.static String
DEFAULT_MAVEN_PROJECT_REF_REFID
The refid used to store an object of typeMavenAntRunProject
containing the Maven project object in the Ant build.static String
DEFAULT_MAVEN_PROJECT_REFID
The refid used to store the Maven project object in the Ant build.protected org.apache.maven.artifact.repository.ArtifactRepository
localRepository
The local Maven repositorystatic String
MAVEN_REFID_PREFIX
The prefix of all refid used by the plugin.static String
TASK_URI
The URI which defines the built in Ant tasksstatic String
UTF_8
The default encoding to use for the generated Ant build.
-
Constructor Summary
Constructors Constructor Description AntRunMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyProperties(org.apache.maven.project.MavenProject mavenProject, org.apache.tools.ant.Project antProject)
Copy properties from the Maven project to the Ant project.void
copyProperties(org.apache.tools.ant.Project antProject, org.apache.maven.project.MavenProject mavenProject)
Copy properties from the Ant project to the Maven project.void
execute()
void
initMavenTasks(org.apache.tools.ant.Project antProject)
-
-
-
Field Detail
-
MAVEN_REFID_PREFIX
public static final String MAVEN_REFID_PREFIX
The prefix of all refid used by the plugin.- See Also:
- Constant Field Values
-
DEFAULT_MAVEN_PROJECT_REFID
public static final String 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 anant
task.- See Also:
- Constant Field Values
-
DEFAULT_MAVEN_PROJECT_REF_REFID
public static final String DEFAULT_MAVEN_PROJECT_REF_REFID
The refid used to store an object of typeMavenAntRunProject
containing 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:
- Constant Field Values
-
DEFAULT_MAVEN_PROJECT_HELPER_REFID
public static final String DEFAULT_MAVEN_PROJECT_HELPER_REFID
The refid used to store the Maven project object in the Ant build.- See Also:
- Constant Field Values
-
DEFAULT_ANT_TARGET_NAME
public static final String DEFAULT_ANT_TARGET_NAME
The default target name.- See Also:
- Constant Field Values
-
UTF_8
public static final String UTF_8
The default encoding to use for the generated Ant build.- See Also:
- Constant Field Values
-
ANTLIB
public static final String ANTLIB
The path to The XML file containing the definition of the Maven tasks.- See Also:
- Constant Field Values
-
TASK_URI
public static final String TASK_URI
The URI which defines the built in Ant tasks- See Also:
- Constant Field Values
-
localRepository
@Parameter(property="localRepository", readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
The local Maven repository
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.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
-MavenProject
antProject
-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
-
-