Search code examples
sonarqubesonar-runner

Sonar Runner Behind a Proxy


I'm trying to use Sonar Runner but keep getting a socket timeout exception. The machine I'm running it on is behind a proxy so I think maybe that is the problem.

I still get the problem when the Sonar Server and the Runner are on the same box so I also don't know if this is a problem with Java not properly picking up the proxy settings from the machine (which is OS X), in particular the address where the proxy should be bypassed.

No matter what my configuration the browser and curl can get to the Sonar Server, its only the Sonar Runner Jar that has a problem.

Can anyone offer any advice about getting Sonar Runner to work behind a proxy?

UPDATE

This does seem to be OS X related as using a Windows VM to get to the same Sonar Server works, since this is Java I'm assuming this is some issue with my Java set-up or my OS X networking set-up?


Solution

  • So it turned out my problem was that the JVM wasn't using the proxy settings of my machine, I had to add the following to the Sonar runner script.

    SONAR_RUNNER_OPTS="-Dhttp.proxyHost=myproxy -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=my.local.host"