Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Idea mapstruct java: Internal error in the mapping processor: java.lang.NullPointerException

After upgrading to the version 2020.3 of Idea i get a NullPointerException for the mapping processor. If anybody has a clue... Thank you!

like image 602
Antonio Avatar asked Dec 02 '20 16:12

Antonio


People also ask

How do I enable MapStruct in IntelliJ?

IntelliJ IDEA If so, open the preferences window, navigate to Compiler -> Annotation processor and untick checkbox “Enable annotation processing” at “Annotation profile for mapstruct-integrationtest”. You should now be able to rebuild MapStruct.

How do you update MapStruct?

Settings -> Build, Execution, Deployment -> Build Tools -> Reload project after changes in the build scripts: From "External Changes" to "Any Changes"


2 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.

like image 172
CrazyCoder Avatar answered Sep 21 '22 22:09

CrazyCoder


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:

Open Preferences --> Build, Execution, Deployment --> Compiler and write ps.track.ap.dependencies=false Preferences --> Build, Execution, Deployment --> Compiler

like image 43
freedev Avatar answered Sep 23 '22 22:09

freedev