idea版本:
IntelliJ IDEA 2021.1.1 (Ultimate Edition)
Build #IU-211.7142.45, built on April 30, 2021
lombok版本
1.18.16
问题排查
lombok的相关issue:https://github.com/projectlombok/lombok/issues/2592
IntelliJ is now wrapping the
ProcessingEnvironmentin aProxy. This lead to a problem for us at MapStruct (mapstruct/mapstruct#2215). While trying to fix that and testing with our examples I realized that our examples with Lombok are not compiling anymore.
大致意思是,IntelliJ新版本在 ProcessingEnvironement 预编译的时候是以代理的方式来执行的,不再是直接 javac方式,所有 lombok依赖的 annotation processors
解决办法
在这增加参数: -Djps.track.ap.dependencies=false

就能正常处理 lombok注解了,
同时提示
java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate.
Use build process "jps.track.ap.dependencies" VM flag to enable/disable incremental annotation processing environment.
本文主要讨论了在IntelliJ IDEA 2021.1.1版本中遇到的Lombok注解处理器不兼容问题。由于IntelliJ采用了新的代理方式处理ProcessingEnvironment,导致Lombok无法正常工作。为了解决这个问题,可以通过在IDE设置中添加'-Djps.track.ap.dependencies=false'参数来恢复Lombok的正确编译。同时,文章提醒这可能会禁用增量注解处理,可能影响部分编译结果的准确性。
2万+

被折叠的 条评论
为什么被折叠?



