For my project, sonarClound was not scanning project because of java source version 11. After I updated java source version to 17 in my feature branch which is not merged to develop (default branch). Still sonarCloud is not scanning the project. If I do local sonar scan I can see the analysis.
I am using Java, Maven and Github action workflows.
Maven command used in github action workflow.
mvn -B -U sonar:sonar -Dsonar.token=${{ secrets.SONARCLOUD_TOKEN }}
-Dsonar.host.url=${{ env.sonar_host_url }}
-Dsonar.projectKey=${{ env.project_key }}
-Dsonar.organization=myorg
-Dsonar.java.source=17
-Dsonar.verbose=true
-Dsonar.pullrequest.key=${{env.CHANGE_ID}}
-Dsonar.pullrequest.branch=${{env.BRANCH_NAME}}
-Dsonar.pullrequest.base=${{env.CHANGE_TARGET}}
-Dsonar.pullrequest.provider=GitHub
-Dsonar.coverage.jacoco.xmlReportPaths='target/site/jacoco/jacoco.xml'
-Dsonar.pullrequest.github.repository=myorg/myproject
-Dsonar.pullrequest.github.endpoint=https://api.github.com
-Dsonar.cpd.exclusions=**/*Dto.java
Note: I have scan the develop branch with java source version 17.

