Lombok项目是否支持Java 9? [英] Does Project Lombok support Java 9?

查看:359
本文介绍了Lombok项目是否支持Java 9?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用了Lombok,但我的同事不同意使用它,原因是(来自关于龙目岛文件的争议)

I have used Lombok in my project, but my colleague do not agree to use it, and his reason is (from controversy of lombok documents)

这两个Lombok项目都利用非公共API来完成其魔术.这意味着存在在后续的IDE或JDK版本中破坏Project Lombok的风险.

Both of these pieces of Project Lombok make use of non-public APIs to accomplish their sorcery. This means that there is a risk that Project Lombok will be broken with subsequent IDE or JDK releases.

但这是一个非常古老的文档,写于2010年,也许现在已经解决了这个问题,所以我想知道Lombok是否将支持Java 9,并且它是否仍使用非公开API:s?

But it's a very old document written in 2010, maybe now it has resolved the problem, so I want to know if Lombok will support Java 9 and does it still use the non-public API:s?

推荐答案

Lombok项目有一个问题跟踪Java 9支持.从2018年1月9日和版本1.16.20开始,Lombok正式支持Java9.来自更改日志:

The Lombok project has an issue tracking Java 9 support. As of January 9th 2018 and version 1.16.20, Lombok officially supports Java 9. From the changelog:

  • PLATFORM:在新的IntelliJ,Netbeans和Gradle中更好地支持jdk9.
  • BREAKING CHANGE:lombok配置键lombok.addJavaxGeneratedAnnotation现在默认为false,而不是true. Oracle在JDK9发行版中打破了此注释,因此需要进行重大更改.
  • BREAKING更改:lombok配置键lombok.anyConstructor.suppressConstructorProperties现在已弃用,默认为true,也就是说,默认情况下,lombok不再自动生成@ConstructorProperties注释.现在,新的配置键lombok.anyConstructor.addConstructorProperties存在;如果您想要旧的行为,请将其设置为true. Oracle在JDK9发行版中或多或少地破坏了此注释,因此有必要进行重大更改.
  • 开发:现在可以在JDK1.9上编译lombok.
  • PLATFORM: Better support for jdk9 in the new IntelliJ, Netbeans and for Gradle.
  • BREAKING CHANGE: lombok config key lombok.addJavaxGeneratedAnnotation now defaults to false instead of true. Oracle broke this annotation with the release of JDK9, necessitating this breaking change.
  • BREAKING CHANGE: lombok config key lombok.anyConstructor.suppressConstructorProperties is now deprecated and defaults to true, that is, by default lombok no longer automatically generates @ConstructorProperties annotations. New config key lombok.anyConstructor.addConstructorProperties now exists; set it to true if you want the old behavior. Oracle more or less broke this annotation with the release of JDK9, necessitating this breaking change.
  • DEVELOPMENT: Compiling lombok on JDK1.9 is now possible.

(目前,它还没有模块,因此您需要将其放在类路径上.谢谢 Tos的回答,它首先提到了这一点.)

(At the moment, it is no module, though, so you need to place it on the class path. Thanks Tos' answer, which first mentioned this.)

这篇关于Lombok项目是否支持Java 9?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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