Hello Geeks,
kindly help me, as I have already invested my 15 days.
Version Info:
SonarQube: 8.2, SonarQube Scanner: 4.2.0.1873, Gradle : 6.3, Java: 11.0.3 (64 bit) Oracle, Database: Postgres, OS: Mac OS X 10.14.4 x86_64
What I am trying to achieve:
I have a code base setup on my local machine.
I need to scan this code and get the report, if any blocker/critical… etc. are there.
What I have done so far:
I have created a project on sonarqube. Downloaded the gradle and Android Studio. Build the project using gradle build. Downloaded sonar-scanner.
My SonarQube server is up and running and it shows Quality Gate as Passed and when I click on Overview, then i got warning as "The main branch has no lines of code."
And when I run sonar-scanner, I get attached scan.txt (22.9 KB) logs
It looks like you’re somehow only analyzing .class files by exceuting analysis from the /Users/mac/git/project-android/target/classes/com/ directory.
21:45:21.123 DEBUG: 'MainActivity.class' indexed with language 'null'
SonarQube scans source code, not compiled classes. And in fact, there’s a specific scanner for Gradle, the SonarScanner for Gradle, which should ensure you don’t have to do much manual configuration or guessing.
And funny enough, the compiled classes are what you seem to have been trying to scan in your first post.
sonar.java.binaries will automatically be set the scanner for Gradle, or you can try manually providing a value. This gets messy quickly if you have more than one module.
My issue is resolved, fyi, I was already using Scanner for Gradle, the issue was in my properties file there was junk character in my path, after removing that it is successful.