I've followed the Immutables
tutorial to use those annotations on IntelliJ Idea
. For some reason the IDE is still showing the generated annotation classes as an error, though the maven
compilation is going forward normally. Any idea how to fix this?
Asked
Active
Viewed 1,550 times
1

Squake
- 370
- 2
- 10
-
Did you try the classic `File -> Invalidate Caches/Restart -> Invalidate and restart`? – Shadov Aug 19 '19 at 10:15
-
Yes, I tried that with no luck =( – Squake Aug 19 '19 at 10:25
4 Answers
0
Adding the annotationPaths to maven compiler plugin worked for me
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${project.build.targetJdk}</source>
<target>${project.build.targetJdk}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<annotationProcessorPaths combine.children="append">
<path>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>${immutables.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

erantol
- 51
- 3
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 25 '23 at 04:47
-1
File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors
Make sure this is enabled

Nabeel Mehmood
- 378
- 1
- 5
-
This is exactly what is described in the official tutorial, not really helpful =( – Squake Aug 19 '19 at 10:26
-
Oh. I've run into similar problems like this with Lombok as well where nothing helped apart from changing the dependency version in my maven build even though I was using the exact same configuration as the tutorial I followed to set it up. Try editing your pom.xml file to use a different version. – Nabeel Mehmood Aug 19 '19 at 10:46
-1
I finally ended up solving that by executing Maven >> Generate Source and Update Folders
.

Squake
- 370
- 2
- 10