[GRADLE-2657] Gradle Sonar plugin broken with Sonar 3.4 Created: 27/Jan/13 Updated: 15/Mar/13 Resolved: 27/Jan/13 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 1.5-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Description |
We are using Gradle 1.3. Caused by: org.sonar.api.utils.SonarException: Fail to load plugin findbugs The same problem is reproducible on my local maschine with a clean Sonar 3.4 installation and the Gradle sample project located in the distribution under samples/sonar/quickstart. But running Sonar on that sample project by using the Sonar Ant tasks did work. I am not sure if this a problem of the new Sonar version or an incompatibility between the Gradle Sonar plugin and the new Sonar version... Please help... |
Comments |
Comment by Gradle Forums [ 27/Jan/13 ] |
thanks for reporting this. I'll have a look on this in the next couple of days and give you feedback. cheers, |
Comment by Gradle Forums [ 27/Jan/13 ] |
We are having the exact same issue. I know you are looking into it so I will deactivate for now or roll back the sonar install for a while. |
Comment by Gradle Forums [ 27/Jan/13 ] |
We are also having the same problem. Please let me know when a solution becomes available. |
Comment by Gradle Forums [ 27/Jan/13 ] |
The Sonar plugin will have to undergo bigger changes to work with Sonar 3.4 and higher. Given that Gradle 1.4 is almost out, this will have to wait at least until 1.5. |
Comment by Gradle Forums [ 27/Jan/13 ] |
Thanks for the information, Peter! For those of you who don ́t want to downgrade your Sonar installation back to <3.4 I have worked out a temporary workaround that hopefully is not too much efford and greatly demonstrates the strenghts of Gradle's Ant integration This is intended to be a relatively simple workaround until Gradle supports Sonar 3.4 again. Unfortunately you need to pass your project settings manually instead of using the Gradle objects, but I guess for most projects it is worth a consideration. Basic idea is to replace the broken sonarAnalyze task by a custom task that uses the original Sonar Ant task. I am using this solution on a multiproject build and I even did not need to change my CI config because the command line call stays the same. I hope this helps, To replace the gradle plugin change the line "apply plugin: 'sonar'" to "apply from 'sonar.gradle'" in your build file(s). sonar.gradle: apply plugin: 'java' repositories { configurations { dependencies { task sonarAnalyze << { // define the Sonar properties according to Sonar Ant task documentation // define multi-project modules // define module specific properties ant.taskdef(name: 'sonar', classname: 'org.sonar.ant.SonarTask', classpath: configurations.sonar.asPath) ant.sonar() |
Comment by Gradle Forums [ 27/Jan/13 ] |
Thanks for the workaround, I'll give it a try. Peter, do you already have a JIRA to track the necessary changes to support sonar 3.4+? Oliver |
Comment by Gradle Forums [ 27/Jan/13 ] |
The work is already mostly done. You can try it in the latest nightly. |
Comment by rafal [ 13/Mar/13 ] |
Is this fixed in 1.5-rc-1? I still have the same problem using gradle-1.5-rc-1 with sonar 3.4.1. |
Comment by Yuriy Malchenko [ 14/Mar/13 ] |
Trying gradle-1.5-rc-1: plugin doesn't seem to work with Sonar 3.5 (same exception). |
Comment by Matt Bellinger [ 14/Mar/13 ] |
Just to make sure, when you tried gradle-1.5-rc-1, did you change to using the sonar-runner plugin instead of the sonar plugin? 1.5-rc-1 introduced the sonar-runner plugin, and it is working for me. http://www.gradle.org/docs/release-candidate/userguide/sonar_runner_plugin.html |
Comment by rafal [ 15/Mar/13 ] |
No, stupid me - I didn't know I have to use sonar-runner. I'll try it, thanks! |