@Mojo(name="run", threadSafe=true, requiresDependencyResolution=TEST) public class AntRunMojo extends 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.
Modifier and Type | Field and 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 type
MavenAntRunProject 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 ArtifactRepository |
localRepository
The local Maven repository
|
static 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 tasks
|
static String |
UTF_8
The default encoding to use for the generated Ant build.
|
Constructor and Description |
---|
AntRunMojo() |
Modifier and Type | Method and Description |
---|---|
void |
copyProperties(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,
MavenProject mavenProject)
Copy properties from the Ant project to the Maven project.
|
void |
execute() |
void |
initMavenTasks(org.apache.tools.ant.Project antProject) |
getLog, getPluginContext, setLog, setPluginContext
public static final String MAVEN_REFID_PREFIX
public static final String DEFAULT_MAVEN_PROJECT_REFID
ant
task.public static final String DEFAULT_MAVEN_PROJECT_REF_REFID
MavenAntRunProject
containing the Maven project object in the
Ant build. This is useful when a custom task needs to change the Maven project, because, unlike
DEFAULT_MAVEN_PROJECT_REFID
, this makes sure to reference the same instance of the Maven project in all
cases.public static final String DEFAULT_MAVEN_PROJECT_HELPER_REFID
public static final String DEFAULT_ANT_TARGET_NAME
public static final String UTF_8
public static final String ANTLIB
public static final String TASK_URI
@Parameter(property="localRepository", readonly=true) protected ArtifactRepository localRepository
public void execute() throws MojoExecutionException, MojoFailureException
public void copyProperties(MavenProject mavenProject, org.apache.tools.ant.Project antProject)
mavenProject
- MavenProject
antProject
- Project
public void copyProperties(org.apache.tools.ant.Project antProject, MavenProject mavenProject)
antProject
- not nullmavenProject
- not nullpublic void initMavenTasks(org.apache.tools.ant.Project antProject)
antProject
- Project
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.