Hello,
- ALM: Gitlab
- CI: Jenkins
- Language: C++
I run Sonar frow Jenkins with:
def RunScanner( _scanner_cmd_suffix )
{
def scannerHome = tool 'SonarQube Scanner from Maven Central';
println( "Running SonarScanner with suffix ${_scanner_cmd_suffix}..." )
withSonarQubeEnv( 'SonarCloud' )
{
def command = "\$env:BUILD_WRAPPER_OUTPUT_DIR=\'../../../bin/sonar-build-wrapper\' ; " +
"& \"${scannerHome}/bin/sonar-scanner.bat\" ${_scanner_cmd_suffix}"
println( command )
powershell( script: command, returnStdout: true )
}
}
In the log, I get:
17:53:17 [2024-09-11T15:53:17.297Z] Running SonarScanner with suffix -'Dsonar.branch.name=master'...
[Pipeline] withSonarQubeEnv
17:53:17 [2024-09-11T15:53:17.315Z] Injecting SonarQube environment variables using the configuration: SonarCloud
[Pipeline] {
[Pipeline] echo
17:53:17 [2024-09-11T15:53:17.402Z] $env:BUILD_WRAPPER_OUTPUT_DIR='../../../bin/sonar-build-wrapper' ; & "C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.SonarRunnerInstallation\SonarQube_Scanner_from_Maven_Central/bin/sonar-scanner.bat" -'Dsonar.branch.name=master'
[Pipeline] powershell (hide)
17:53:35 [2024-09-11T15:53:35.403Z] sonar-scanner.bat : 17:53:32.288 ERROR Error during SonarScanner Engine execution
17:53:35 [2024-09-11T15:53:35.403Z] At C:\Program Files (x86)\Jenkins\workspace\QtPlugins\CMake\source\modules\QtPlugins@tmp\durable-9bd2015d\powershellScript.ps1:1 char:68
17:53:35 [2024-09-11T15:53:35.403Z] + ... -wrapper' ; & "C:\Program Files (x86)\Jenkins\tools\hudson.plugins.so ...
17:53:35 [2024-09-11T15:53:35.403Z] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:53:35 [2024-09-11T15:53:35.403Z] + CategoryInfo : NotSpecified: (17:53:32.288 ER...ngine execution:String) [], RemoteException
17:53:35 [2024-09-11T15:53:35.403Z] + FullyQualifiedErrorId : NativeCommandError
17:53:35 [2024-09-11T15:53:35.403Z]
17:53:35 [2024-09-11T15:53:35.403Z] java.lang.IllegalStateException: java.nio.file.NoSuchFileException: C:\Program Files
17:53:35 [2024-09-11T15:53:35.403Z] (x86)\Jenkins\workspace\QtPlugins\CMake\source\modules\QtPlugins\..\..\..\bin\sonar-build-wrapper\compile_commands.json
The Grrovy code in Jenkins is OK (this code has several years).