Tag Archives: maven-antrun-plugin

Maven – Run maven-antrun-plugin without attaching to a lifecycle phase

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 ?

Advertisements

Maven – Start Jetty Server by Ant task using maven-antrun-plugin

I have the following shell script to start the Jetty Server in my portable web application in Windows.
start_jetty.bat

start java -DSTOP.PORT=8080 -DSTOP.KEY=stop_jetty -jar start.jar
EXIT

Continue reading Maven – Start Jetty Server by Ant task using maven-antrun-plugin