Spock and Roo - Maven's conventions step in to mess with me
Thursday, May 24, 2012 at 6:06PM Ok, here's a cautionary tale.
I had everything working just fine in one project using Spock - on Jenkins builds I was getting code coverage working. It was great!
Hey, listen, keep this in mind:
src/test/java is NOT src/main/groovy! Now my jQuery project is starting to use code coverage - go ahead and view the report...
Oh, and one more thing: bind them to test-compile, not test. AAAHH!
:)
Ok, here's my maven build fragment for running the tests (I assume now that the file set is no longer needed...)
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.4</version>
<configuration>
<providerSelection>1.8</providerSelection>
</configuration>
<executions>
<execution>
<id>test-run</id>
<goals>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
<phase>test-compile</phase>
<configuration>
<sources>
<fileSet>
<directory>src/test/groovy</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</fileSet>
</sources>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.7</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.6-groovy-1.8</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-spring</artifactId>
<version>0.6-groovy-1.8</version>
</dependency>
</dependencies>
</plugin>
Spock,
maven,
roo add-ons,
spring-roo,
testing in
Spring Roo 