[GRADLE-1813] Sonar fails on nested multiproject builds Created: 28/Sep/11 Updated: 04/Jan/13 Resolved: 13/Jan/12 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-5 |
Fix Version/s: | 1.0-milestone-8 |
Type: | Bug | ||
Reporter: | René Gröschke (Inactive) | Assignee: | Unassigned |
Resolution: | Not A Bug | Votes: | 2 |
Description |
When applying the sonar plugin to the gradle sample project (subprojects/docs/samples/java/multiproject) the build fails with the message: It seems that applying the Plugin to (:services:shared) fails because the plugin was already applied to (:shared). INMHO, the full qualified project name is not considered. Find the full stack trace below:
|
Comments |
Comment by Rob Kirkbride [ 09/Oct/11 ] |
I've hit this as well in milestone 5 nightly. Unless there's a workaround, it's a show stopper for us moving to milestone 5. |
Comment by René Gröschke (Inactive) [ 17/Oct/11 ] |
With the latest snapshot I've found a convenient 'workaround' for this. It should be well documented, that the sonar plugin for multi projects shall be applied to the root project only. Maybe I find the time to create a pull request for this. IMHO there are be two ways to solve issue: regards, |
Comment by Gunnar Hillert [ 10/Jan/12 ] |
In my opinion both use-cases should be possible. Usually I do want to run Sonar globally from the Root project as part of a nightly build. However, throughout the day I may run the Sonar task locally to get a report for a sub-module without have to through the pain of running the entire build. This has been working fine in Maven based builds and should also be supported by Gradle. |
Comment by Peter Niederwieser [ 13/Jan/12 ] |
It's already supported. If you apply the plugin to the root project, you can analyze just a subproject. What you cannot do is apply the plugin both to a parent and a child project. The plugin is not supposed to be used like that. |
Comment by Peter Niederwieser [ 13/Jan/12 ] |
Apparently I was wrong about this. Seems there is no easy way to have both things. If you want this, please create a feature request. It's not something that's easy to implement though. |
Comment by Peter Niederwieser [ 13/Jan/12 ] |
What you can do is to apply the plugin to each leaf project. This is how the first version of the plugin worked. Drawbacks are that you get no accumulated view in the Sonar web interface and that analysis takes longer and requires more memory. |
Comment by Peter Niederwieser [ 13/Jan/12 ] |
Works as designed. I'll add some clarifying words to the user guide. |