Can i skip Analysis completely and send only only Jacoco.xml

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 :wave:

You cannot skip the Sonar analysis since Sonar analysis is what imports the Jacoco code coverage xml report.


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 "", ""
                property "sonar.organization", "fun"
                property "sonar.projectKey", "fun"
                property "sonar.projectName", "fun"
                property "sonar.projectVersion", 'fun'
                property "sonar.login", "fun"
                property "", "*/build/classes/java/main/"
                property "", "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 nor the sonar.sources. Please give it a try and see if it works out.

1 Like

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:

And this StackOverflow post may help you:

If you still have issues, please post your build.gradle here or send me a private message.


1 Like

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.

Hi @MomEngineer ,

Did you figure it out your issue? I have a working multimodule gradle project with code coverage working if you want to use it as a reference.

I think we are fine, Thanks thought. Would love to see your implementation in SonarQube git

1 Like

@MomEngineer : here’s the link: sonar-scanning-examples/sonarqube-scanner-gradle/gradle-multimodule-coverage at master · SonarSource/sonar-scanning-examples · GitHub


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