'JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate
Since IntelliJ IDEA 2020.3.2
(I use Community Edition), I started getting:
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
warning, upon running the application within the IntelliJ IDEA.
This actually happens during the build phase, when you run your application for the "first" time (to be more precise, when target
(or whatever you have configured as a building result directory) is being built).
What does this message mean?
Solution 1:[1]
As IDEA's build is incremental, it uses wrapper interfaces in order to collect some data that will help incremental analysis to correctly compile files affected by changes.
The -Djps.track.ap.dependencies=false
option if added in:
File > Settings/Preferences > Build, Execution, Deployment > Compiler.
Then field Build process VM options disables collection of dependencies specified by an annotation processor when Filer methods are called.
In later versions of IntelliJ, the settings is now under: File > Settings > Build, Execution, Deployment > Compiler, then field Shared build process VM options
See some more details in this issue: IDEA-252069.
Solution 2:[2]
I was using an older version of Lombok, changing to newer version fixed the issue in IntelliJ
Old version:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
New version:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
Solution 3:[3]
In my case i was trying to use an old version lombok plugin (version 1.16.16), but it's an old plugin version, I updated to 1.18.20 (obs.: today is july 2021) and it works well.
Solution 4:[4]
I had to remove the target dir with rm -Rf ./target
or mvn clean
, then inside IntelliJIDEA's Maven panel, I clicked on the Icon "Reload all maven projects".
I also tried to "Invalidate cache and restart".
Not sure what was working but it solved my error.
Solution 5:[5]
We can do all operations in IntelliJ IDEA.
- add -Djps.track.ap.dependencies=false in proper place.
- In the right of IDEA, click Maven -> Reload All Maven Projects.
- Also in the Maven -> Excute Maven Goal (represented by a 'm' icon) -> mvn clean -> enter
- Then Excute Maven Goal -> mvn install -> enter
- Build -> Rebuild Project.
Thank Andrey, djangofan and Falcon.
Solution 6:[6]
In my case,the specific error is couldn't find one class file. I open it and find the suffix magically becomes '.aj'. Change it back to '.java'. It works for me.
Solution 7:[7]
1.New version added in pom.xml
enter code here
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
enter code here
2.mvn clean -> build project
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | kevinarpe |
Solution 2 | loakesh bachhu |
Solution 3 | Guilherme Almeida |
Solution 4 | Karl.S |
Solution 5 | lyx3030 |
Solution 6 | ??? |
Solution 7 | Roman Fu |