After upgrading to the version 2020.3 of Idea i get a NullPointerException for the mapping processor. If anybody has a clue... Thank you!
5 Answers
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.
- 371,688
- 155
- 943
- 850
-
4After upgrading Mapstruct to 1.4.1.Final I am getting another issue which I did not get with 1.3 - "No method found annotated with @Named#value". Has anyone faced this problem yet? – Barun Dec 08 '20 at 03:07
-
1You just need to add the @Named annotation over the method and qualifiedByName where it was used. – Javeson Yehudi Dec 09 '20 at 13:31
-
Upgrading it solved the issue for me .Thanks! – Samir Nov 06 '21 at 08:11
-
1IDE should not be the driver to force lib update on a project. – dimitrisli Dec 28 '21 at 16:48
-
3Thanks, adding ```-Djps.track.ap.dependencies=false``` really helped me! – ademarizu Jan 04 '22 at 18:41
-
After upgrading Mapstruct to 1.4.1.Final I am getting another issue which I did not get with 1.3 - "No method found annotated with @Named#value", and i have this method in parent class (inheritance). these methods are there for long time – uncle bob Apr 05 '22 at 02:31
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:
- 21,315
- 4
- 98
- 111
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>
- 529
- 1
- 4
- 14
Expanding on freedev's answer. For windows users the following will be the place to go :
- 1,189
- 1
- 12
- 36