gmaven-plugin适用于groovy 1.7.5,但不适用于2.1.0 [英] gmaven-plugin works for groovy 1.7.5 but not for 2.1.0

查看:110
本文介绍了gmaven-plugin适用于groovy 1.7.5,但不适用于2.1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有工作maven 2安装程序,它编译用groovy编写的jUnit测试。 java和groovy测试都位于/ src / test / java中

查看pom.xml的快照



< pre class =lang-xml prettyprint-override> < plugin>
< groupId> org.codehaus.gmaven< / groupId>
< artifactId> gmaven-plugin< / artifactId>
< version> 1.3< / version>
<执行次数>
<执行>
< id> testCompile< / id>
<目标>
< goal> testCompile< / goal>
< /目标>
<配置>
< sources>
< fileset>
< directory> $ {pom.basedir} / src / test / java< / directory>
<包括>
< include> ** / *。groovy< / include>
< / includes>
< / fileset>
< / sources>
< / configuration>
< /执行>
< /执行次数>
< / plugin>

< dependency>
< groupId> org.codehaus.groovy< / groupId>
< artifactId> groovy< / artifactId>
< version> 1.7.5< / version>
< scope> test< / scope>
< /依赖关系>

当我升级到插件版本1.5和groovy 2.1.0时,* / .groovy文件被忽略。有没有人遇到过这个问题?

解决方案

好的,这个配置适用于maven 2。

 < plugin> 
< groupId> org.codehaus.gmaven< / groupId>
< artifactId> gmaven-plugin< / artifactId>
< version> 1.4< / version>
<配置>
< providerSelection> 2.0< / providerSelection>
< sourceEncoding> UTF-8< / sourceEncoding>
< / configuration>
<执行次数>
<执行>
<目标>
< goal> testCompile< / goal>
< /目标>
<配置>
< sources>
< fileset>
< directory> $ {pom.basedir} / src / test / java< / directory>
<包括>
< include> ** / *。groovy< / include>
< / includes>
< / fileset>
< / sources>
< / configuration>
< /执行>
< /执行次数>
< / plugin>

< dependency>
< groupId> org.codehaus.groovy< / groupId>
< artifactId> groovy< / artifactId>
< version> 2.0.0< / version>
< scope> test< / scope>
< /依赖关系>


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?

解决方案

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>

这篇关于gmaven-plugin适用于groovy 1.7.5,但不适用于2.1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆