In order to automate some FitNesse tests in our system I need to essentially do the following:
- Build everything in Maven.
- Start a server process using the built code.
- Run FitNesse tests against the server.
This is all fine, except for starting the server within the Maven integration-test phase. Mainly, I'm not really sure how to get the project classpath into the java task; the FitNesse Java task is working fine, but that doesn't need to access the compiled classes. So far, I have the following Maven config but the first Java execution fails because the class is not found. Presumably I need this task to behave something like the surefire plugin and use a classpath with all compiled projects and dependencies.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>start-fitnesse-integration</id>
<phase>integration-test</phase>
<configuration>
<tasks>
<echo taskname="fitnesse" message="Starting Server..."/>
<java classname="com.xyz.ServerProcess" fork="true" failonerror="true">
<jvmarg value="-Xmx1024m"/>
<!-- etc. -->
</java>
<echo taskname="fitnesse" message="Starting Fitnesse tests..."/>
<java classname="fitnesseMain.FitNesseMain" classpathref="maven.runtime.classpath" fork="true" failonerror="true">
<!-- FitNesse command - works OK -->
</java>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
How should the classpath be specified for the first Java task? Ideas for alternate solutions also welcome.