I believe the basic thing I need to know is, how can I set the project GroupId via the Sonar plugin?
Detail: I’m using Gradle 1.0-M3 and Sonar IDE for Eclipse 2.2. I can successfully run a Sonar analysis from Gradle. It appears in Sonar with key = “:MyProject”. Note the empty GroupId (before the colon). When I attempt to configure MyProject to use the Sonar IDE for Eclipse, I get an error message “empty GroupID for project MyProject”. Thus I believe I need to set a non-empty GroupId in the Sonar plugin for Gradle.
FYI, the Sonar plugin has been completely redesigned/rewritten for the upcoming M5. Among other things, it’s now faster and can handle larger multi-project builds.
I had a single-project build, and I set project.group at the “top-level” of the script. It is not inside of a configuration block or task definition. The same level at which you apply a plugin or set sourceCompatibility, for example.
I have a multi-project build but am starting out just running sonar on one subproject. I started trying to set project.group=“com.company.team” at the top of the subproject’s build.gradle outside of any blocks, but that didn’t work either.
If you set the Gradle project’s name and group, you should get decent defaults for the Sonar project’s key and name. Unsure why this wouldn’t work for you. Alternatively, you can set key and name explicitly like you did.
We have an existing Sonar server with these projects set up and I’m trying to match the key/name exactly. We’re switching from standard Ant to Gradle so I’m just trying to work out the kinks so it’s as close to our existing build as possible.
That’s fine. I’m just saying that I don’t understand why setting project.group didn’t work for you (if that’s supposed to mean “had no effect whatsoever”).
That’s fine. I’m just saying that I don’t understand why setting project.group didn’t work for you (if that’s supposed to mean “had no effect whatsoever”).