SonarQube analysis issue -

May 2024 ยท 1 minute read

Dec 8, 2023 Beatrice Clogston

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

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobWxpaW6GdoCOrKanmaKmwqOxjJqlmqSpqLa0ecisqq6d

ncG1vNJzZmilmK2xb7LRmmhnnJmctrWty6ianpmeqL2ir8SsZZynnWTAsLrAq6iumpVirq%2Bty7KqoqtdnsC0wcRnn62lnA%3D%3D