I am getting below errors for project classes. (NOT project dependent/external libs) I found below logs in Jenkins.
**21:12:14** [WARNING] Classes not found during the analysis : [project classes]
Below is the command use in Jenkins
void publish_to_sonar() {
withSonarQubeEnv('sonarq') {
rtMavenRun(
pom: './pom.xml',
goals: "-B -Dapp.version=${APP_VERSION} -Djava.awt.headless=true sonar:sonar -Dsonar.java.binaries=target/classes -P sonar".toString(),
resolverId: "APP_MAVEN_RESOLVER"
)
}
echo "Published the unit test results to sonar"
}
The other thing noticed was, despite of above class not found warning could see the files in sonar portal under the “code” tab with percentage covered.
Versions used:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\apache-maven-3.6.3\bin\..
Java version: 1.8.0_281, vendor: Oracle Corporation, runtime: C:\Java\jdk1.8.0_281\jre
sonar-maven-plugin-3.9.0.2155
<jacoco.plugin.version>0.8.6</jacoco.plugin.version>