None of the advanced answers to this question resolved the problem for me.
I managed to solve the problem by adding a dependencie to lombok in the pom.xml file, i.e. :
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.12</version>
</dependency>
I am using IntelliJ 2016.3.14 with maven-3.3.9
Hope my answer will be helpful for you