I don't believe you need to define the dependencies on gmaven-mojo and 
gmaven-runtime any longer.

Maybe add a dependency on Groovy?  Or see what the output is for running:

  $ mvn -Dgmaven.logging=DEBUG
I believe this POM gives some sort of a bare minimum needed to run the Groovy 
tests.  In a small project of mine, it runs the tests found under 
src/test/groovy:

<?xml version="1.0" encoding="utf-8"?>

  <modelVersion>4.0.0</modelVersion>
  <groupId>prystasj</groupId>
  <artifactId>test</artifactId>
  <name>Example Project</name>
  <version>1.0-SNAPSHOT</version>
  <build>
    <plugins>
      <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>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>1.7.4</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>





________________________________
From: Ed Young <[email protected]>
To: Maven Users List <[email protected]>
Sent: Mon, January 17, 2011 10:59:32 AM
Subject: Re: Groovy Maven project and groovy tests

thanks for the reply. I've added it to my build section, but still not
running my test in src/test/groovy + package name.

Here's my entire pom:


http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.comcast.neto</groupId>
    <artifactId>ChimpsFuncTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ChimpsFuncTest</name>
    http://maven.apache.org

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>


        <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>

        <dependency>
            <groupId>org.codehaus.geb</groupId>
            <artifactId>geb-core</artifactId>
            <version>RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>RELEASE</version>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>

                <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>

            </plugins>
        </pluginManagement>
    </build>

</project>

See anything amiss?

On Mon, Jan 17, 2011 at 8:27 AM, John Prystash <[email protected]> wrote:

> 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]
> ------------------------------------------------------------------------
>
>
>
>
>



-- 
- Ed



      

Reply via email to