How to add GINT integration test to Maven build

If you want to run a GINT integration test as part of a Maven build, add something like the following to the pom.xml file within the build plugins section.

pom.xml addition
<build>
    ...
    <plugins>
        ...
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <executable>gant</executable>
                <arguments>
                    <argument>-f</argument>
                    <argument>src/itest/groovy/myTest.gant</argument>
                    <argument>-DxmlReport</argument>
                    <argument>-Dclean</argument>
                </arguments>
                <skip>${gint.skip}</skip>
            </configuration>
        </plugin>
        ...
    </plugins>
    ....
</build>
Maven command
mvn integration-test
Skipping GINT tests
mvn -Dgint.skip=true ...

Build Error on Windows

... was unexpected at this time is a Windows command line error that can occur when executing the gant command from Maven. It is caused by the gant.bat script when there are blanks in path names. Fortunately, there is also a gant.exe on more recent versions of Groovy/Gant on Windows. To force the use of gant.exe instead of gant.bat, simply rename gant.bat to something else or move it out of the bin directory. This means the gant.exe will be used instead and will behave better than the bat version.