我正在尝试编译一个用groovy编写一些测试的项目。该项目具有--enable-preview for Java12。
我用gmavenplus插件来做这个:
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.3</version>
<configuration>
<targetBytecode>${java.version}</targetBytecode>
<testSources>
<testSource>
<directory>${testSourceDirectory}</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin> 我有用于maven编译器的--enable-preview和尽责/故障安全(使用argLine)。如果我禁用groovy插件(和测试),一切都会正常工作。
但是,当我启用它时,它会失败,因为:
Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.3:compileTests (default) on project apikey-manager-api: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: Preview features are not enabled for com/acme/config/EndToEndTest (class file version 56.65535). Try running with '--enable-preview' -> [Help 1]我没有看到任何选项,我可以传递到这个插件,以启用预览功能。它使用javac吗?或者说,这种选择是否应该成为一种选择?
发布于 2019-06-06 01:04:08
随着Groovy (GROOVY-9073)和GMavenPlus (#125)的改变,现在可以使用Groovy 2.5.7+ / 3.0.0-beta-1+的GMavenPlus 1.7.1了。
https://stackoverflow.com/questions/55337570
复制相似问题