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

java: Couldn't retrieve @Mapper annotation

or

Internal error in the mapping processor: java.lang.NullPointerException

Edit: To fix the error in IDEA 2020, you can add 

-Djps.track.ap.dependencies=false

 in menu

File | Settings | Build, Execution, Deployment | Compiler | User-local build process VM options (overrides Shared options)