Beginner here!
Wondering if was possible to skip SonarCloud/Qube analysis and just push the Jacoco.xml for starters.
Beginner here!
Wondering if was possible to skip SonarCloud/Qube analysis and just push the Jacoco.xml for starters.
Hi @MomEngineer,
Welcome to SonarSource community
You cannot skip the Sonar analysis since Sonar analysis is what imports the Jacoco code coverage xml report.
Joe
Thank you.
Some context- I have a multi-module project that is compiled with Java 8. I am launching Sonar gradle task with Java 11. Can i skip compiling the Java sources but just provide location to compiled Java 8 binaries?
Sonarqube {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "fun"
property "sonar.projectKey", "fun"
property "sonar.projectName", "fun"
property "sonar.projectVersion", 'fun'
property "sonar.login", "fun"
property "sonar.java.binaries", "*/build/classes/java/main/"
property "sonar.java.source", "8"
property "sonar.sources", "."
property "sonar.coverage.jacoco.xmlReportPaths", "../jacoco/*.xml"
}
}
Since you are using the Sonar Gradle scanner, you don’t need to specify the sonar.java.binaries
nor the sonar.sources
. Please give it a try and see if it works out.
Thank you, @Joe!!! I will try it out and respond back! Things we learn when actually trying out SonarCloud!
Meanwhile, one more question, I have close to 20 modules in my project. I am using a single sonarcloud project to capture this 20 module project. I followed this documentation.
For instance, the following would run sonarqube for each module ( kicking off :module1: sonarqube, :module2:sonarqube)- which is totally fine.
./gradlew sonarqube
However, when viewed in sonarcloud, the results of module 1 is overwritten by results of module 2. So, when i look at the overview page of the sonarCloud project - I pretty much get the results of the last module. I am sure I am missing something very elementary- Can you please give me some pointers.
Glad to hear you’re making progress!
Here is an example of a Sonar Scanner for Gradle multi-module project you can reference: https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner-gradle-multimodule
And this StackOverflow post may help you: https://stackoverflow.com/questions/62015834/sonar-with-multi-module-gradle-project
If you still have issues, please post your build.gradle
here or send me a private message.
Joe
Little bit of digging , I would like to limit the modules I am using Sonarqube on using gradle’s configure(). what is happening is each of the module:sonarqube execution uses the same project key but is not recognizing the module name (folder name)
Able to proceed further. Had to tweak my incredibily complicated build.gradle. However- observing that Code Coverage is disastrously zero. Working through this issue.