首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Groovyc和Java 12预览功能

Groovyc和Java 12预览功能
EN

Stack Overflow用户
提问于 2019-03-25 12:14:18
回答 1查看 497关注 0票数 1

我正在尝试编译一个用groovy编写一些测试的项目。该项目具有--enable-preview for Java12。

我用gmavenplus插件来做这个:

代码语言:javascript
复制
        <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插件(和测试),一切都会正常工作。

但是,当我启用它时,它会失败,因为:

代码语言:javascript
复制
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吗?或者说,这种选择是否应该成为一种选择?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-06 01:04:08

随着Groovy (GROOVY-9073)和GMavenPlus (#125)的改变,现在可以使用Groovy 2.5.7+ / 3.0.0-beta-1+的GMavenPlus 1.7.1了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55337570

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档