Hello Omar
As explained in my "Sonar vs JUnit" post, Spock works beautifully with Sonar as it uses internally the
JUnit runner. This means that Sonar and Maven can run Spock tests and "see" them as JUnit tests.
Code coverage works like JUnit.
An example is shown in chapter 7 of the book.
The code uses the Jacoco plugin, Maven and nothing else. There is no Spock-specific configuration that you need in Sonar.
Here is the pom file
https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/pom.xml
And here is the screenshot from Sonar from this example (attached on this post)
Kostis