We use lombok plugin:
-io.freefair.lombok" version “5.3.3.3” for getters and setters for our project, and
Sonar plugin
-‘org.sonarqube’ version ‘3.1.1’
in build.gradle for our project
with java 8
gradle version: 6.8.3
Now issue is when we merge code with main branch with any new variable added say for eg @Getters
private String testLombok;
and xxxx.getTestLombok();
, it goes through sonarqube analysis and it give a code smell like
Remove this unused “testLombok” private field.
Are you really using @Getters? Or is it @Getter? Could you tell me the fully qualified name (name of the import), to be sure we are talking about the same thing?
We are using @Getter. but to answer my own question: I have fixed this issue by following the suggestion mentioned in:
we added the copyDependency step/gradle task which runs in Sonarqube test stage and SonarQube is able to pick it up now and we added:
sonar.java.libraries=build/libs,build/dependencies