SonarCloudAnalyze failed for java project

I would like to add sonarCloud to my java project. I got the error :Your project contains .java files, please provide compiled classes with property, or exclude them from the analysis with sonar.exclusions property.

I was searching this issue a lot and I knew to solve it, I should add to my sonarCloud (Java | SonarQube Docs). Even I added it, I still get the error. Please help me.

this is my .yml file

and this is my error:

Hi @saeedeh.masoumi ,

Welcome to SonarSource Community! :sonarsource:

It looks like your Java version is still not set correctly for SonarCloud analysis. Please try setting as defined in Java | SonarCloud documentation as part of the extraProperties key and see if that works for you.


Thanks Joe for your quick response. I did a silly mistake, that’s why sonar analysis was failed.
I put colon instead of equal for and for, I assigned string value. so I changed it to this and it works :slightly_smiling_face:


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.