------ Usage ------ Kenney Westerhof, Franz Allan Valencia See, Vincent Siveton ------ September 2006 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Usage * Run The maven-antrun-plugin has only one goal, <<>>. This allows Maven to run Ant tasks. To do so, there must be an existing project and maven-antrun-plugin must have its <<<\>>> tag configured (although it would still execute without the <<<\>>> tag, it would not do anything). Below is the template for <<>>'s <<>>. ------ [...] maven-antrun-plugin ${project.version} run [...] ------ Moreover, you can add a script to each lifecycle phase, by duplicating the <<<\>>> section and specifying a new phase. Ultimately, you could specify some Ant {{{http://ant.apache.org/manual/using.html#targets}<<<\>>>}} attributes in the <<<\>>> tag. Only <<>> attribute in Ant <<<\>>> is not wrapped. ------ [...] [...] ------ * Additional source directories If your Ant tasks generate additional source code that needs to be added to the build, you can use the {{{http://www.mojohaus.org/build-helper-maven-plugin/}build-helper-maven-plugin}}. The <<>> and <<>> options of the antrun plugin are removed as of version 3.0.0. * Using Maven properties All of the properties available to Maven are also available in the target configuration. However, you may want to call an external Ant build script using the task. To avoid name conflicts, only a subset of the properties are passed to the external Ant build. These include all properties defined in the section of the POM. It also includes prefixed versions of some of the commonly used Maven properties. ------ maven.project.groupId maven.project.artifactId maven.project.name etc. ------ If the Maven property you want to use is not available in an external file, you will have to redefine the property before calling . ------ ------ * Ant Expressions to Maven Expressions Mapping Some Ant expressions have their respective counterparts in Maven. Thus, one can simply invoke the corresponding Maven expression instead of using maven-antrun-plugin to avoid the unneccessary overhead. *-----------------------------------+-----------------------------------+ | <> | <> | *-----------------------------------+-----------------------------------+ | Built-in Tasks | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antrun-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antrun-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{http://maven.apache.org/guides/introduction/introduction-to-profiles.html}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{http://maven.apache.org/guides/introduction/introduction-to-profiles.html}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-dependency-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-ear-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-jar-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-jar-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-javadoc-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-jar-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-war-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | Optional Tasks | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antlr-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-dependency-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-ejb-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-deploy-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-surefire-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-surefire-report-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-deploy-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-deploy-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+