Hey Ed, I believe you need to add an executions element containing the
testCompile goal.
Below is my gmaven configuration:
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.2</version>
<configuration>
<providerSelection>1.7</providerSelection>
</configuration>
<extensions>true</extensions>
<inherited>true</inherited>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
Hope this helps
________________________________
From: Ed Young <[email protected]>
To: Maven Users List <[email protected]>
Sent: Mon, January 17, 2011 10:13:17 AM
Subject: Groovy Maven project and groovy tests
I want to create a groovy maven project and be able to execute groovy tests,
Geb test, spock tests, etc.
To start, I just want to execute tests that extend GroovyTestCase. I placed
tests in src/test/groovy, but they won't execute. Only the tests in
src/test/java will execute.
I created the project using the quickstart archetype, then configured the
pom from the gmaven 1.0 wiki.
<http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>
<project>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-mojo</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy.maven.runtime</groupId>
<artifactId>gmaven-runtime-1.6</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
I then added src/test/groovy and an example Test:
package com.mydomain.whatever;
import groovy.util.GroovyTestCase
class GroovyAppTest extends GroovyTestCase {
void testSomething() {
assert 1 == 1
assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
}
}
when I run mvn test I get:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
[INFO] Final Memory: 16M/81M
[INFO]
------------------------------------------------------------------------