相关疑难解决方法(0)

Maven使用gmaven-plugin编译混合Java + Groovy 1.7项目

根据前两个答案:maven dependencies groovy.我正在尝试使用来自org.codehaus.gmaven的GMaven-plugin,使用Maven编译混合Java 6 + Groovy项目.直到昨天我们使用的是旧1.6.0版本的Groovy(在我们最终完成它之后从未改变它),但由于1.7.0现在稳定,我认为我们会改用它.

如果只是那么简单......我现在遇到的问题似乎有两个方面:

  • Groovy 1.6以某种方式仍然被选为默认值.(如下面的stacktrace中所示)
  • groovy:generateStubs因构建错误而停止:意外节点:节点[7:1,64,注释]

有谁知道如何解决上述两个问题,或者可以提供一个工作pom来编译与Maven Java 6代码混合的Groovy 1.7代码?

使用gmaven/groovy.maven/groovy.maven.gmaven编译旧版本的Groovy时,有很多令人困惑/矛盾/过时的文档,现在真的没有帮助.

作为参考,这是我的pom.xml和Maven -e输出的一部分:

<dependencies>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>1.7.0</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.2</version>
            <dependencies>
                <dependency>
                    <groupId>org.codehaus.gmaven.runtime</groupId>
                    <artifactId>gmaven-runtime-1.7</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                    <version>1.7.0</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <goals>
                        <goal>generateStubs</goal>
                        <goal>compile</goal>
                        <goal>generateTestStubs</goal>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

[INFO] ------------------------------------------------------------------------
[INFO] Building Client
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: …
Run Code Online (Sandbox Code Playgroud)

java groovy compilation maven gmaven-plugin

32
推荐指数
2
解决办法
2万
查看次数

标签 统计

compilation ×1

gmaven-plugin ×1

groovy ×1

java ×1

maven ×1