I am trying to use SonarCloud with an Azure Devops Pipeline with a self-hosted agent to build a maven project.
I have a corporate proxy.
I added three tasks:
- SonarCloudPrepare
- Maven
- SonarCloudPublish
I had to add an envirnoment variable to make maven task to complete with no errors due to the connection to sonarcloud.io.
I added:
JAVA_TOOL_OPTIONS: '-Dhttps.proxyHost=myProxyUrl -Dhttps.proxyPort=myProxyPort -Dhttp.proxyHost=myProxyUrl -Dhttp.proxyPort=myProxyPort “-Dhttps.nonProxyHosts=localhost|.mydomain" "-Dhttp.nonProxyHosts=localhost|.mydomain” ’
I am not able to find a solution for SonarCloudPublish.
I tried to set SONAR_SCANNER_OPTS with the same value of JAVA_TOOL_OPTIONS, but i get always this errors:
##[error][SQ] Could not fetch metrics
##[error][SQ] API GET ‘/api/metrics/search’ failed, error was: {“code”:“ECONNRESET”}
##[error][SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ECONNRESET”}
Looks to me that the SonarCloudPublish task is not using the proxy.
My configuration is:
Windows server 2016
Maven 3.6.3
OpenJdk 11
Any suggestions?
Kind Regards
Gianluca