Sonarqube Analysis Issue

Sonarqube Analysis Issue

I am getting below error while building project with Sonarqube:

The following errors occurred during analysis:
  Exception analyzing com.org.client.employee.EmployeeClient using detector com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector
  java.lang.NullPointerException
  At com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector.analyzeMethod(SpringEntityLeakDetector.java:107)
  At com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector.visitClassContext(SpringEntityLeakDetector.java:68)
  At edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
  At edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1080)
  At edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:281)
  At org.sonar.plugins.findbugs.FindbugsExecutor$FindbugsTask.call(FindbugsExecutor.java:235)
  At java.util.concurrent.FutureTask.run(FutureTask.java:266)
  At java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  At java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  At java.lang.Thread.run(Thread.java:748)

I am trying to exclude client directory from sonar coverage but looks like exclusion is not working:

property "sonar.coverage.exclusions", "**/client/**"

Below are the version I am using:

SonarQube - 7.9
Gradle - 4.9
Spring Boot - 2.1.3
Java - Jdk8

1 Answer

The proper syntax to ignore the whole client package is:

**/client/**/*

Read more at the documentation for SonarQube 7.9 Narrowing the Focus.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor
Author

Sophia Al-Mansoor

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.