2 | | To integrate Ant with Maven you have to use maven-antrun-plugin, so you just have to add the following section in your pom.xml file of the parent project: |
3 | | {{{ |
4 | | <build> |
5 | | <plugins> |
6 | | <plugin> |
7 | | <groupId>org.apache.maven.plugins</groupId> |
8 | | |
9 | | <artifactId>maven-antrun-plugin</artifactId> |
10 | | |
11 | | <executions> |
12 | | <execution> |
13 | | <phase>compile</phase> |
14 | | |
15 | | <configuration> |
16 | | <!-- Put the Ant Tasks that you wish to call here --> |
17 | | <tasks> |
18 | | <echo>Copy Resources </echo> |
19 | | |
20 | | <copy file="${basedir}/source" tofile="${basedir}/target/" overwrite="true" /> |
21 | | </tasks> |
22 | | </configuration> |
23 | | |
24 | | <goals> |
25 | | <goal>run</goal> |
26 | | </goals> |
27 | | </execution> |
28 | | </executions> |
29 | | </plugin> |
30 | | </plugins> |
31 | | </build> |
32 | | }}} |
| 2 | Apache Ant is integrated in Maven using maven-ant-plugin, so there is goal in Maven named ant. You have two options which are ant:ant and ant:clean. |
| 3 | * executing '''mvn ant:ant''' Maven create build.xml files which can be used by Ant later |
| 4 | * '''mvn:clean''' remove the created build.xml files if there are any. |
| 5 | Good tutorial to get into Apache Ant: http://supportweb.cs.bham.ac.uk/docs/tutorials/docsystem/build/tutorials/ant/ant.html [[BR]] |
| 6 | You must follow the steps explained in [wiki:PLATFORM_INFRASTRUCTURE_OVERVIEW#ApacheAnt] page to have ant installed on your machine. |
| 7 | Now you can build the project using Ant with the simple command '''ant'''. |