JPS增量注释处理被禁用。部分重新编译的编译结果可能不准确
因为IntelliJ IDEA 2020.3.2(我使用社区版),我开始得到:
Parsing java... [applicationname]
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.
Writing classes
警告,在 IntelliJ IDEA 中运行应用程序时。
这实际上发生在构建阶段,当您“第一次”运行应用程序时(更准确地说,target是在构建时(或您配置为构建结果目录的任何内容))。
这个消息是什么意思?
回答
由于 IDEA 的构建是增量的,它使用包装器接口来收集一些数据,这些数据将有助于增量分析正确编译受更改影响的文件。
-Djps.track.ap.dependencies=false如果添加该选项:
File > Settings/Preferences > Build, Execution, Deployment > Compiler。然后字段Build process VM options在调用 Filer 方法时禁用注释处理器指定的依赖项集合。
在 IntelliJ 的更高版本中,设置现在位于:
File > Settings > Build, Execution, Deployment > Compiler,然后字段Shared build process VM options
请参阅此问题的更多详细信息:IDEA-252069。
- Adding that flag does not fix it for me on IntelliJ 2020.3.2 Ultimate
- Thank you for the answer; however, to me, this reads as a gibberish. Maybe you know the background context.. but not all do. Could you elaborate on what does it mean, that "IDEA's build is incremental"? what are "wrapper interfaces"? what for?.. what **some** data(this seems a new thing..) is IDEA collecting?
- @Giorgi Tsiklauri, in the latest IntelliJ version, the settings is now under _File | Settings | Build, Execution, Deployment | Compiler | Shared build process VM options_. It works for me. For your question about what does it mean, this issue happens only when you get some annotation processor like Lombok and is linked to the way IntelliJ handle incremental recompilation for what I understand. Why this option is not set by default? That is the question…