I\'m trying to use Maven to start an application prior to running some integration tests on it. I\'m on Windows. My Maven plugin configuration looks like this:
Try this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>start-my-application</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>call</executable>
<arguments>
<argument>start_application.bat</argument>
</arguments>
<workingDirectory>./path/to/application</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
For the record, a rather hackish solution is to use maven-antrun-plugin
to call Ant, which is capable of spawning separate processes:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>pre-integration-test</phase>
<configuration>
<target>
<exec executable="cmd"
dir="./path/to/application"
spawn="true">
<arg value="/c"/>
<arg value="start_application.bat"/>
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>