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

Hi,
I receiving the below error on in my sonarqube instance that i run locally as a means to give some assurance that quality of code i’m importing to our project thats been supplied to us from a 3rd party . Not being a java developer i’m not sure how i can resolve this . the source code provided to us does not the have any .class files in it just “from what i can see” a standard java project.

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.

Hi @whiteninja76,

This thread is nearly a year old. Per the FAQ, please create a new thread with all your details.

 
Ann