[GRADLE-3062] Update Sonar Runner to 2.3 Created: 04/Apr/14 Updated: 05/Jan/15 Resolved: 02/Sep/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.11 |
Fix Version/s: | 2.2-rc-1 |
Type: | Improvement | ||
Reporter: | Peter Niederwieser | Assignee: | Luke Daley |
Resolution: | Fixed | Votes: | 47 |
Attachments: | buildSrc.zip sonar.gradle |
Description |
I got contacted by Julien Henry from SonarSource, saying that: "[...] we are planning to stop supporting SQ Runner < 2.3 in one of the upcoming SQ releases (sooner or later). Since relying on a particular Sonar runner version has caused some problems in the past, it would be even better to make the version and/or dependency configurable (cf. code quality plugins). The recent pull request for executing Sonar Runner in a separate process should make this even easier to implement. |
Comments |
Comment by Andrew Kowal [ 10/Jul/14 ] |
Any plans for fixing this issue? A few days ago SQ 4.4-RC2 has been released and sonar-runner plugin doesn't work with that version. |
Comment by Paul Macdona [ 31/Jul/14 ] |
SQ 4.4 has now been released and I can confirm the sonar-runner plugin does not work. |
Comment by Stéphane Nicoll [ 04/Aug/14 ] |
Hey Peter, thanks for reporting this. We were also trying to use SQ 4.4 and are affected by this now as well. Thanks! |
Comment by Holger Stolzenberg [ 05/Aug/14 ] |
Our company just upgraded to SQ 4.4. All Gradle builds on the CI env now fail, because the Gradle "sonar-runner" plugin is not compatible with the SQ-4.4 API. As everything maven related is still working, we will not rollback. This effectively means that we have to disable Sonar analysis of all Gradle driven builds, which is definitely a bad thing for us. The builds are run using gradle-2.0. The update of the sonar-runner and the sonar-runner-plugin are very much appreciated. Should I file a separate issue for the sonar-runner plugin? |
Comment by Timothy M. Rodriguez [ 05/Aug/14 ] |
I've also hit this issue with Gradle 1.12 and Sonar 4.4. The error is an IllegalStateException because it can't download the libraries from the server. |
Comment by Baptiste Chatrain [ 06/Aug/14 ] |
Also hit the issue with Gradle 2.0 and Sonar 4.4. Same error : can't download the libraries from server |
Comment by Chris Mousset [ 12/Aug/14 ] |
We are also having this problem. |
Comment by clt [ 12/Aug/14 ] |
Upgrading Sonar to 4.4 caused all builds to fail: [12:43:57]12:43:57.444 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://<servername:port>/batch/ [12:43:57]12:43:57.444 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.Bootstrapper.remoteContent(Bootstrapper.java:125) [12:43:57]12:43:57.444 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.Bootstrapper.downloadBatchFiles(Bootstrapper.java:158) [12:43:57]12:43:57.444 [ERROR] [org.gradle.BuildExceptionReporter] ... 59 more |
Comment by Richard Bolkey [ 12/Aug/14 ] |
Have now encountered this too. |
Comment by Vikram Gadang [ 13/Aug/14 ] |
Any work around for this? |
Comment by Tomáš Kotula [ 14/Aug/14 ] |
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://<servername:port>/batch/ Here is what the url above returns in my case: {"errors":[{"msg":"Bad filename: "}]} |
Comment by Peter Niederwieser [ 14/Aug/14 ] |
There isn't currently a workaround other than downgrading your Sonar installation. A pull request is underway that should fix this problem. |
Comment by Richard Bolkey [ 14/Aug/14 ] |
The workaround that I used was to generate the sonar-project.properties file (as expected by the sonar runner) using the sonarProperties property on the sonarRunner task (I added the action to do so onto the check task). Then I ran the sonar-runner cmd line tool where I generated the properties file. It works out acceptably since you can still leverage Gradle for all the configuration. |
Comment by Peter Niederwieser [ 14/Aug/14 ] |
That's indeed an option. |
Comment by Holger Stolzenberg [ 15/Aug/14 ] |
@Richard Bolkey @Peter Niederwieser |
Comment by Mike Gilbode [ 15/Aug/14 ] |
Attached is my sonar configuration using the runner in case it's useful to anyone. Just do apply from: 'sonar.gradle' from the root project. I first run build / test / jacoco before executing the sonar task. |
Comment by Richard Bolkey [ 15/Aug/14 ] |
This is what I did: tasks.check << { } and then just run SonarQube's sonar-runner from the command line. |
Comment by Andrew Kowal [ 15/Aug/14 ] |
Here is my quick fix for running analysis with new sonarqube. The only thing you need to change in the build script is to replace old sonar plugin with:
apply plugin: 'sonarqube-runner'
|
Comment by Holger Stolzenberg [ 18/Aug/14 ] |
Any chance the 'sonarqube-runner' plugin will make it into the next official gradle release? |
Comment by Martin Flower [ 19/Aug/14 ] |
We also have this problem.
|
Comment by Holger Stolzenberg [ 19/Aug/14 ] |
Just a quick thought. Of course it is better to only have one 'sonar-runner' plugin. |
Comment by Serge SIMON [ 27/Aug/14 ] |
Any news about this ? |
Comment by Andrew Kowal [ 27/Aug/14 ] |
Serge, you just need to place buildSrc directory to your project root. It will be automatically detected by gradle on the next build. |
Comment by Nathan Redding [ 09/Sep/14 ] |
Any rough idea when this will make it to release? We have a new instance of Sonar and would like to be able to publish to it from our gradle build. Also - seems weird that the plugin is released as part of gradle itself and not on an independent schedule. |
Comment by Tad Reeves [ 09/Sep/14 ] |
I see this was marked as fixed. Does this mean that it's going into the 2.2 release? If so, when will that make GA? I've been running Sonar on the 3.7.4 LTS version as a workaround for this, but owing to features in the pipeline, I'll soon need to update to v4+, which will break our gradle builds. |
Comment by Oliver Trosien [ 11/Sep/14 ] |
@Tad : you can test it by running a nightly version of gradle 2.2. That's what we are doing now. @Peter: Was there a reason for not going straight to 2.4? Or is there a way to set the sonar-runner version in the build myself? UPDATE: Found the flag myself. On the root project, you just need to do this: sonarRunner { toolVersion = '2.4' } |
Comment by Tim Pizey [ 24/Sep/14 ] |
With the current nightly and the above configuration { toolVersion = '2.4' }on ubuntu with java I fail with: SonarQube Runner 2.4 ERROR: null FAILURE: Build failed with an exception.
[snip] Caused by: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/j2sdk1.6-oracle/bin/java'' finished with non-zero exit value 1 BUILD FAILED |
Comment by David Moshal [ 28/Sep/14 ] |
So, as a relatively new user of Gradle, I'm really disappointed. This sort of lock-in and inflexibility is exactly the same as that of Maven - no difference at all. The Gradle plugin supports sonar-runner version 2.0, which is incompatible with the current sonarqube server (4.4), and additionally is no longer actively supported by sonarqube. Yet, despite being reported by an actual founder of Gradle, presumably with far more knowledge of plugin internals than your average user, a month later it appears that no-one has been able to get the plugin to support the new version (2.3) of sonar-runner. This for a plugin decribed in the Core Gradle documentation! Someone should tell Hans Dockter to stop quoting Moshe Feldenkrais' phrase about "making the impossible possible", because, from what I can see, at least in this case, Gradle === Maven. I guess Ant is the only way to go (again, for a core Gradle plugin) - such a joke. David |
Comment by Luke Daley [ 28/Sep/14 ] |
David Moshal Gradle 2.2 allows you to choose your own Sonar Runner version. If you need this now you can use the nightly builds. |
Comment by Tim Pizey [ 29/Sep/14 ] |
@Luke but as noted above the current nightly is failing with error message 'null' |
Comment by Luke Daley [ 29/Sep/14 ] |
Tim Pizey this should be fixed as of a few days ago. Please try again. |
Comment by Tim Pizey [ 05/Jan/15 ] |
I have revisited this and, after deleting my cached gradle files, this worked. |