Long time ago, i had a post about running Ant in Maven using the maven-antrun-plugin but the Ant script would be attached to the Maven lifecycle phase.
Sometimes you may just want to run a standalone Ant task in Maven without being involved in any lifecycle phase. In that case, you can try configure the maven-antrun-plugin as follow.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<configuration>
<tasks>
<echo message="Hello world"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</plugin>
You can run it directly by
- mvn antrun:run
Done =)
Reference: StackOverflow – How to call maven-antrun-plugin target without attach execution to a maven phase ?
