Your project contains .java files, please provide compiled classes with sonar.java.binaries property

Hello,
Can you help me out with this error.
ERROR: Error during SonarScanner execution org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.

While running the jenkins pipeline im getting this error and if im adding “sonar.java.binaries=.” OR “sonar.exclusions = **/*.java” the build is not getting complete, its getting stuck in between.

Hi,

Are .class files actually present somewhere under .?

 
Ann

No not present

Hi,

You need to compile before analysis and then point sonar.java.binaries to where the .class files are.

 
Ann

Okay so the build is now successfully running after adding the "sonar.exclusions=**/*.java
" but now the coverage got disappeared itself in the Sonarqube.
Coverage comes from the lcov.info, right? And I have even placed this file, its not even in any of the directory:

Analysis Properties:
sonar.projectKey=hk-backend-evolved
sonar.projectName=hk-backend-evolved
sonar.sources=.
sonar.host.url=
sonar.login=sqp_ba3604bdbb3334ad377859262
sonar.javascript.lcov.reportPaths=lcov.info
sonar.exclusions=**/*.java

Hi,

Please create a new thread if you want to pursue coverage. Also, please immediately revoke the token exposed above.

 
Thx,
Ann