<project xmlns="http://maven.apache.org/POM/4.0.0" xsi="http://www.w3.org/2001/XMLSchema-instance" schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelversion>4.0.0</modelversion>
<groupid>mygroup</groupid>
<artifactid>hw</artifactid>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Print Hello World</name>
<build>
<defaultgoal>validate</defaultgoal>
<plugins>
<plugin>
<inherited>false</inherited>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-antrun-plugin</artifactid>
<executions>
<execution>
<id>helloworld</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo>Hello World!</echo>
<echo>Hello World!</echo>
<echo>JAVA_HOME=${java.home}</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupid>ant</groupid>
<artifactid>ant</artifactid>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
$ mvn
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Print Hello World
[INFO] task-segment: [validate]
[INFO] ------------------------------------------------------------------------
[INFO] [antrun:run {execution: helloworld}]
[INFO] Executing tasks [echo] Hello World! [echo] Hello World! [echo] JAVA_HOME=c:\j2sdk1.4.2_18\jre
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Sep 09 10:00:44 EDT 2008
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------