I get an error when I execute “Run Code Analysis” in an Azure DevOps pipeline
“##[error]Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8”
This output causes the element to “fail” in the pipeline, even if execution is successful.
SonarQube plugin for Azure DevOps (formerly VSTS), version 4.6.0
The agent is operating in a Kubernetes environment based on Ubuntu.
JAVA_TOOL_OPTIONS is not set by our pipeline implementation, it’s coming from Microsoft.
Sonar runner’s execution causes a “Picked up …” message to STDERR (feature of Java runtime!)
I have a “Run Code Analysis” block in the pipeline
I see no potential workaround: right now. I see no option to remove JAVA_TOOL_OPTIONS from the pipeline’s environment.
Is it possible to provide a plugin update where this error output is redirected so that the DevOps agent does not classify the output as error?
Any other solution?
I’ve just started seeing this in my Linux builds in Azure DevOps too. Debug from my SonarQubeAnalyze task in my build on an ubuntu-18.04 Microsoft-hosted build agent:
Same issue here in Azure DevOps on ubuntu-latest.
Please do something about this incorrect error message
Starting: SonarQubeAnalyze
==============================================================================
Task : Run Code Analysis
Description : Run scanner and upload the results to the SonarQube server.
Version : 4.11.0
Author : sonarsource
Help : Version: 4.11.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
/home/vsts/work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/4.11.0/sonar-scanner/bin/sonar-scanner --from=ScannerAzureDevOps/4.11.0
##[error]Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
If you take the time to read this topic you’ll find out that this is not caused by the scanner.
We are still evaluating whether we’ll find a way to suppress that particular output to stderr.
we are using SQ plugin 4.23.1, Azure self-hosted agent with AdoptOpenJDK Java 11.0.11 and build fails with “Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=…” which is the only one “error”.
Since the output of “Picked up…” message into an error stream seams to be an unoverridable feature of Java, is there any workaround on SQ scanner side to “succeed” the build?