mavengroovygmaven-plugin

gmaven-plugin works for groovy 1.7.5 but not for 2.1.0


I have working maven 2 setup which compiles jUnit tests written in groovy. Both java and groovy tests are located at /src/test/java

See a snapshot of the pom.xml

<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <version>1.3</version>
    <executions>
        <execution>
        <id>testCompile</id>
        <goals>
            <goal>testCompile</goal>
        </goals>
        <configuration>
            <sources>
                <fileset>
                    <directory>${pom.basedir}/src/test/java</directory>
                    <includes>
                        <include>**/*.groovy</include>
                    </includes>
                </fileset>
            </sources>
        </configuration>
        </execution>
    </executions>
</plugin>

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy</artifactId>
    <version>1.7.5</version>
    <scope>test</scope>
</dependency>

When I upgrade to plugin version 1.5 and groovy 2.1.0, */.groovy files are ignored. Has anybody met up with this problem?


Solution

  • Ok, this configuration works for maven 2.

    <plugin>
        <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.4</version>
            <configuration>
                <providerSelection>2.0</providerSelection>
                <sourceEncoding>UTF-8</sourceEncoding>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <fileset>
                                <directory>${pom.basedir}/src/test/java</directory>
                                <includes>
                                    <include>**/*.groovy</include>
                                </includes>
                            </fileset>
                        </sources>
                    </configuration>
                </execution>
            </executions>
    </plugin>
    
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>2.0.0</version>
        <scope>test</scope>
    </dependency>