This snippet shows how to invoke a target in ANT from Maven 2. The ANT build script file name is build.xml and is residing in the same folder as of the pom.xml. "createthumbnail" is the name of the target that will be invoked in build.xml. The invocation will happen during deploy phase [that is when we execute mvn deploy command]
Also I have shown how to pass property values to the ANT build script. In build.xml you can use imagefiles.folder as if it was declared locally using ${imagefiles.folder}
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>executionid</id>
<phase>deploy</phase>
<configuration>
<tasks>
<property name="imagefiles.folder" value="./src/main/images/"/>
<ant antfile="build.xml">
<target name="createthumbnail"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
