Gradle, skip test-task when doing sonarqube-task

gradle

(Frank Kluthe) #1

Hey,

I am using the sonar-gradle-plugin (2.6.2) in a Grails project (3.1.15) in combination with Jacoco (0.8.1)

I want to separate my regular unit tests from my integration tests. In grails, i have two tasks for this purpose: test and integrationTest (https://github.com/grails/grails-core/blob/master/gradle/integration-test.gradle).

To get a report for unit-tests i simply do

gradle sonarqube

To get a report for my integration-tests i tried:

gradle integrationTest sonarqube

However, this gives me a combined report, (unit + integration test in one report). I think this is because the sonarqube-task is internally depending on the test-task and therefore is doing it all the time. Any idea how to work around this?


(Frank Kluthe) #2

^^ just found a workaround:

In gradle you can skip task with -x option. So in order to only get a report with my integration-tests (and skip test task) I do:

gradle integrationTest sonarqube -x test