sonarRunner issue with 2.2-20140910134745+0000

I know you are in the process of fixing sonarRunner with Gradle 2.2 so this may be too early to report. I’m seeing the following when I do “gradlew sonarRunner” using gradle nightly 2.2-20140910134745+0000

at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
        ... 1 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_67\bin\java.exe" (in directory "J:\git\gradledemo\access"): CreateProcess error=206, The filename or extension is too long
        at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
        ... 4 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long

Full stacktrace here https://gist.github.com/bradthurber/c3fe4ba672d9c9ef7064

I suspect it may not like like the space in “C:\Program Files”? I could always install java somewhere else, but I thought this would be worth fighting through since it is the default location Oracle specifies on setup.

This is my first attempt at using Sonar in quite some time so it is quite possible there is a configuration issue on my part as well. The relevant part of my build.gradle:

apply plugin: 'sonar-runner'
sonarRunner {
    sonarProperties {
        property "sonar.host.url", "http://localhost:9000/"
        property "sonar.jdbc.url", "jdbc:h2:tcp://localhost:9092/sonar"
        property "sonar.jdbc.driverClassName", "org.h2.Driver"
       property "sonar.jdbc.username", "sonar"
        property "sonar.jdbc.password", "sonar"
    }
}

Hi Brad,

These types of early reports are very useful. Thank you.

Is suspect that the actual command line invocation to start the process is too long for Windows.

Could you try moving your Gradle project to the root of C: drive, and also running with ‘-g c:/.gradle’ temporarily. The goal here is to shorten the paths to see if this fixes the problem. If it does we know that’s the problem.

Hi Luke,

I moved my project to “C:\a” and ran with -g c:/.gradle.

C:\a>gradlew sonarRunner -g c:/.gradle

It is still failing as before.

I should have mentioned that I also tried setting JAVA_HOME to the DOS ‘dir /x’ short path

JAVA\_HOME=C:\Progra~1\Java\JDK17~1.0_6

but it still appears to be using the “long” java directory instead - as I still see “C:\Program Files\Java\jdk1.7.0_67\bin\java.exe” in the stacktrace.

Brad

Can you please run with ‘–info’ and provde the output. I need to see the full command that it’s using to launch the runner.


It looks like the runner command-line is an astounding ~200K long!

Output with --info is here

https://dl.dropboxusercontent.com/u/46209058/output.log

Hey Bradley, I can confirm the problem. thanks for the report. I’ve raised https://issues.gradle.org/browse/GRADLE-3168 for this.

Hi,

I’ve fixed this on master. It should be in the next nightly. If you could try it out and let us know that would be very helpful.

Thanks.

Hi Luke,

This problem is fixed now. Nice work.

Thank you, Brad

Thanks for letting us know Brad.