maven-antrun-plugin allows maven user to add ant tasks in different maven life cycle phases. To use the maven-antrun-plugin, add the following text in the pom.xml.
<!-- Build Configuration -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>initialize</id>
<phase>initialize</phase>
<configuration>
<tasks>
<echo>Hello Maven</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
This is the output after running mvn initialize
...
[INFO] task-segment: [initialize]
[INFO] ------------------------------------------------------------------------
[INFO] [antrun:run]
[INFO] Executing tasks
[echo] Hello Maven
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Dec 16 18:04:57 CST 2009
[INFO] Final Memory: 2M/7M
[INFO] ------------------------------------------------------------------------
Done =)

What is the setup for the antrun plugin?
Do I add a patrh/jar to somewhere?
I don’t see anything to download on the apache site?
Thanks :?)
LikeLike
You dun need to setup/download anything, just include it in the maven project pom.xml =)
LikeLike