After upgrading to the version 2020.3 of Idea i get a NullPointerException for the mapping processor. If anybody has a clue... Thank you!
The solution is to update MapStruct to 1.4.1.Final or later version, see this issue for more details.
You can also add -Djps.track.ap.dependencies=false
at File | Settings (Preferences on macOS) | Build, Execution, Deployment | Compiler | Build process VM options as a workaround.
-Djps.track.ap.dependencies=false
really helped me! –
Kehr mapstruct-processor
to 1.4.1.Final or later version –
Hemorrhoidectomy If you cannot update MapStruct (my case), details here.
You have to find the exact place where put the -Djps.track.ap.dependencies=false
setting (and I had hard time to figure out where).
So, as they say, a picture is worth a thousand words:
There are several intellij bugs here. If I change the maven version 1.3.0.Final to 1.4.1.Final the intellij don't want to update the version.
Solution
- Upgrade the maven version to 1.4.1.Final
- Delete manually mapstruct 1.3.1.Final from External Libraries(Project Structure | Libraries)
- mvn clean package
- Click reload all maven projects
It works without -Djps.track.ap.dependencies=false
If you have swagger exclude mapstruct first:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
<exclusions>
<exclusion>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
</exclusion>
</exclusions>
Expanding on freedev's answer. For windows users the following will be the place to go :
In my case, I made these changes and it works perfectly for me.
Then I just deleted the caches and rebuilt the entire project, maybe it wasn't necessary but that worked for me.
In my case my build.gradle was misconfigured. I used some Mapstruct SPI AccessorNamingStrategy in two separat projects (command and custom-mapper) which I included twice in annotationProcessor of the build gradle. My solutions was to remove one of the annotations and it worked.
© 2022 - 2024 — McMap. All rights reserved.