# Gradle 2.2 nightly sonarRunner task fails with toolVersion = "2.4"

**URL:** <https://discuss.gradle.org/t/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4/1791>\
**Category:** Old Forum Archive\
**Created:** [September 24, 2014, 8:22pm UTC](https://discuss.gradle.org/t/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4/1791 "2014-09-24T20:22:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brad\_thurber](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brad_thurber/32/453_2.png) [@brad\_thurber](https://discuss.gradle.org/u/brad_thurber)\
**Post date:** [September 24, 2014, 8:22pm UTC](https://discuss.gradle.org/t/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4/1791/1 "2014-09-24T20:22:00Z")

</div>

I feel like I’m piling on with another sonarRunner issue in 2.2 nightly.

If I use the new toolVersion = “2.4” as in the gradle 2.2 nightly release notes, gradle sonarRunner task fails. If I instead set this to toolVersion = “2.3” (which I understand gradle defaults to), then sonarRunner task completes.

When toolVersion is set to 2.4, the failure is happening in the sonar runner code.

```gradle
ERROR: Error during Sonar runner execution
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:514)
        at org.sonar.runner.Conf.initRootProjectBaseDir(Conf.java:90)
        at org.sonar.runner.Conf.loadProjectProperties(Conf.java:79)
        at org.sonar.runner.Conf.properties(Conf.java:52)
        at org.sonar.runner.Main.executeTask(Main.java:70)
        at org.sonar.runner.Main.execute(Main.java:59)
        at org.sonar.runner.Main.main(Main.java:53)

```

In Conf.java:89 the code gets a -Dproject.home from the sonarRunner.jar command-line and uses it as the the sonar.projectBaseDir rather than the value that is actually IN sonar-project.properties. Strange

I can get it to work manually if I add -Dproject.home to the command-line that gradle is generating for the sonarRunner task and set it to the value of sonar.projectBaseDir in sonar-project.properties. For example:

C:\Program Files\Java\jdk1.7.0\_67\bin\java.exe -Dproject.settings=J:\git\gradledemo\access\build\tmp\sonarRunner\sonar-project.properties -Xmx1024m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\bradthurber.gradle\caches\modules-2\files-2.1\org.codehaus.sonar.runner\sonar-runner-dist.42482668102eb7f288dadd774658b58e7175c063\sonar-runner-dist-2.4.jar org.sonar.runner.Main -Dproject.home=J:\git\gradledemo\access

I don’t know if the right solution for gradle is to add this parameter to the sonarRunner command line or not. I’m very much a sonar novice and it seems strange that the sonar code would ignore the sonar.projectBaseDir value.

Brad

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [September 24, 2014, 11:42pm UTC](https://discuss.gradle.org/t/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4/1791/2 "2014-09-24T23:42:00Z")

</div>

I’ve fixed this. Will be in the next nightly build.

Thanks for the report!

---

<div class="post-metadata">

**Author:** ![brad\_thurber](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brad_thurber/32/453_2.png) [@brad\_thurber](https://discuss.gradle.org/u/brad_thurber)\
**Post date:** [September 28, 2014, 10:28pm UTC](https://discuss.gradle.org/t/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4/1791/3 "2014-09-28T22:28:00Z")

</div>

Luke,

This appears fixed in “2.2-20140927220014+0000”

Tested with sonar runner 2.4 against just-released sonarQube 4.4.1

Brad

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [September 29, 2014, 1:51am UTC](https://discuss.gradle.org/t/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4/1791/4 "2014-09-29T01:51:00Z")

</div>

Great, thanks for confirming.
