Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to ignore lombok annotations - Sonarqube

I'm trying to ignore lombok annotations in my Java project when using the code coverage tool "Sonarqube", I researched a lot about this and I ended adding this property to the "lombok.config" file:

lombok.addLombokGeneratedAnnotation = true

But when I execute "mvn test" or the "Run with coverage" option in IntelliJ I got this error in the console:

Unknown key 'lombok.addLombokGeneratedAnnotation' (C:\Projects\...\lombok.config:3)

And of course the generated coverage test still isn't ignore the lombok annotations, I'm using 0.8.1 version of Jacoco and 1.16.2 version of lombok.

Any idea how to make this work?

like image 273
Marco Marchetti Avatar asked Oct 09 '18 14:10

Marco Marchetti


1 Answers

Lombok javadoc says

NB: As of v1.16.2 which introduces this annotation, lombok doesn't actually add this annotation; we're setting it up so that lombok jars in widespread use start having this, which will make it easier to actually apply it later on.

So try to update your lombok version. I have 1.18.2 and it works.

like image 102
Alexander Pankin Avatar answered Sep 25 '22 00:09

Alexander Pankin