Update Sonar CLI scanner 5.0.1 to 6.1

Hi,

from Sonar Scanner CLI 5.0.1 to 6.x the environment variable changed from
SONAR_SCANNER_OPTS to SONAR_SCANNER_JAVA_OPTS

There’s also a bunch of new proxy properties, see

Right now with Sonar Scanner CLI 5.0.1 we use this proxy settings
'-Dhttps.proxyHost=xxx-xxx-xxx-com.foo.bar -Dhttps.proxyPort=10080 -Dhttp.nonProxyHosts=*.com.foo.bar -Dhttp.socket.timeout=240000 -Dsonar.ws.timeout=600'

For the transition to Sonarqube Scanner CLI 6.1 - beside of setting both environment variables -
i guess i’ll need to provide proxy settings that work with version 5.0.1 and 6.1, as not all projects will change at once.

Questions
Do i have to use a mixture like i.e.
'-Dhttps.proxyHost=xxx-xxx-xxx-com.foo.bar -Dsonar.scanner.proxyHost=xxx-xxx-xxx-com.foo.bar ...'

to support both versions ?

How does this affect the Sonar Maven plugin, as it’s a wrapper for the CLI scanner ?
The latest 4.0 version works fine with the ‘old’ proxy properties, do i also need to use a mix
of old and new proxy properties to be sure to support the 4.0 version and also upcoming versions ?

Gilbert

Hey @Rebse

To the best of my knowledge, right now there’s no plan to deprecate and remove the -Dhttps.* or -Dhttp.* settings just because we introduced the new sonar.scanner.* parameters. If that changes, we’ll announce it, but so far no deprecations.

The Maven scanner does not support the new properties/environment variables yet.

1 Like

Hey @Colin

ok, this means I currently only have to set both environment variables for Sonar CLI Scanner 5 and 6 => SONAR_SCANNER_OPTS and SONAR_SCANNER_JAVA_OPTS

Have a great weekend,
Gilbert

Yes, this is a bit of a unique one, because SONAR_SCANNER_OPTS is now passed to the process that bootstraps the scanner, while SONAR_SCANNER_JAVA_OPTS gets passed to the scanner itself.

So to maintain compatibility for both versions, yes, you’ll need to include both.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.