Unit test is not showing in java project

unable to view the unit test in sonarqube dashboard below is the configuration.

sonar.projectKey=entitlementservice
sonar.qualitygate.wait=true
sonar.java.coveragePlugin=jacoco
sonar.jacoco.reportPath=./entitlementservice/target/jacoco/jacoco.exec
sonar.junit.reportPaths=./entitlementservice/target/surefire-reports
sonar.tests=src/test/java 
sonar.test.inclusions=src/test/java/**/*
sonar.sourceEncoding=UTF-8
sonar.sources=src/main/java
sonar.java.binaries=**/*
sonar.language=java
sonar.sources=src/main/java/

. Please let know the what wrong in the configuration. Any help would be apreciated

Hi,

Welcome to the community!

On the face of it, your test execution report should be being picked up. Would you care to share your analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

Regarding your other properties:

  • sonar.java.coveragePlugin=jacoco - this does nothing
  • sonar.test.inclusions=src/test/java/**/* - this is entirely redundant, given your sonar.tests specification
  • sonar.java.binaries=**/* - this is pretty broad. Are you sure you can’t narrow it down a bit?
  • sonar.language=java - this does nothing
  • sonar.sources=src/main/java/ - you specify this twice, with and without a trailing slash. No need for both. In this case, the last one wins, BTW

And based on the paths in your configuration, it looks like you’re using Maven to compile? If so, you should be using the SonarScanner for Maven for analysis.

 
Ann