dotnet core 2.0 version of scanner is not accepting sonar.host.url: Unrecognized command line argument: d:sonar.host.url=https://sonarcloud.io

499 views
Skip to first unread message

artur.m...@gmail.com

unread,
May 27, 2018, 2:08:01 AM5/27/18
to SonarQube
67 % Total % Received % Xferd Average Speed Time Time Time Current
68 Dload Upload Total Spent Left Speed
69100 640 0 640 0 0 640 0 --:--:-- --:--:-- --:--:-- 2735
70100 926k 100 926k 0 0 926k 0 0:00:01 0:00:01 --:--:-- 2720k
71unzip scanner.zip
72Archive: scanner.zip
73 inflating: Newtonsoft.Json.dll
74 inflating: SonarQube.Analysis.xml
75 inflating: SonarScanner.MSBuild.Common.dll
76 inflating: SonarScanner.MSBuild.dll
77 inflating: SonarScanner.MSBuild.PostProcessor.dll
78 inflating: SonarScanner.MSBuild.PreProcessor.dll
79 inflating: SonarScanner.MSBuild.runtimeconfig.json
80 inflating: SonarScanner.MSBuild.Shim.dll
81 inflating: SonarScanner.MSBuild.Tasks.dll
82 inflating: SonarScanner.MSBuild.TFS.dll
83 inflating: sonar-scanner-3.1.0.1141/bin/sonar-scanner
84 inflating: sonar-scanner-3.1.0.1141/bin/sonar-scanner-debug
85 inflating: sonar-scanner-3.1.0.1141/bin/sonar-scanner-debug.bat
86 inflating: sonar-scanner-3.1.0.1141/bin/sonar-scanner.bat
87 inflating: sonar-scanner-3.1.0.1141/conf/sonar-scanner.properties
88 inflating: sonar-scanner-3.1.0.1141/lib/sonar-scanner-cli-3.1.0.1141.jar
89 inflating: Targets/SonarQube.Integration.ImportBefore.targets
90 inflating: Targets/SonarQube.Integration.targets
91chmod +x sonar-scanner-3.1.0.1141/bin/sonar-scanner
92bash coverage.sh
93coverage.sh: line 1: #!/bin/bash: No such file or directory
94CLI args: -c Release
95Restoring
96 Restoring packages for C:\projects\build\Build.Tests\Build.Tests.csproj...
97 Restoring packages for C:\projects\build\Build\Build.csproj...
98 Generating MSBuild file C:\projects\build\Build\obj\Build.csproj.nuget.g.props.
99 Generating MSBuild file C:\projects\build\Build\obj\Build.csproj.nuget.g.targets.
100 Restore completed in 205.3 ms for C:\projects\build\Build\Build.csproj.
101 Restoring packages for C:\projects\build\Build.Tests\Build.Tests.csproj...
102 Installing Microsoft.NETCore.Jit 1.0.2.
103 Installing Microsoft.NETCore.Runtime.CoreCLR 1.0.2.
104 Installing Microsoft.NETCore.DotNetHostPolicy 1.0.1.
105 Installing Microsoft.NETCore.App 1.0.0.
106 Installing dotnet-xunit 2.3.1.
107 Installing Microsoft.NETCore.Platforms 2.0.0-preview2-25405-01.
108 Installing SixLabors.Fonts 1.0.0-beta0003.
109 Installing System.Memory 4.4.0-preview2-25405-01.
110 Installing System.Diagnostics.TextWriterTraceListener 4.0.0.
111 Installing System.ComponentModel.EventBasedAsync 4.0.11.
112 Installing Microsoft.DotNet.PlatformAbstractions 1.0.3.
113 Installing xunit.abstractions 2.0.1.
114 Installing SixLabors.Shapes.Text 1.0.0-beta0003.
115 Installing SixLabors.Shapes 1.0.0-beta0003.
116 Installing SixLabors.ImageSharp 1.0.0-beta0002.
117 Installing SixLabors.Core 1.0.0-beta0004.
118 Installing Microsoft.TestPlatform.ObjectModel 15.8.0-preview-20180510-03.
119 Installing Microsoft.Extensions.DependencyModel 1.0.3.
120 Installing xunit.extensibility.core 2.4.0-beta.1.build3958.
121 Installing xunit.extensibility.execution 2.4.0-beta.1.build3958.
122 Installing xunit.runner.visualstudio 2.4.0-beta.1.build3958.
123 Installing coverlet.msbuild 2.0.0.
124 Installing SixLabors.ImageSharp.Drawing 1.0.0-beta0002.
125 Installing xunit 2.4.0-beta.1.build3958.
126 Installing Microsoft.NET.Test.Sdk 15.8.0-preview-20180510-03.
127 Installing ReportGenerator.Core 4.0.0-alpha6.
128 Installing xunit.analyzers 0.8.0.
129 Installing xunit.assert 2.4.0-beta.1.build3958.
130 Installing xunit.core 2.4.0-beta.1.build3958.
131 Installing Microsoft.CodeCoverage 1.0.3.
132 Installing Microsoft.TestPlatform.TestHost 15.8.0-preview-20180510-03.
133 Restore completed in 5.39 sec for C:\projects\build\Build.Tests\Build.Tests.csproj.
134 Generating MSBuild file C:\projects\build\Build.Tests\obj\Build.Tests.csproj.nuget.g.props.
135 Generating MSBuild file C:\projects\build\Build.Tests\obj\Build.Tests.csproj.nuget.g.targets.
136 Restore completed in 6.29 sec for C:\projects\build\Build.Tests\Build.Tests.csproj.
137SonarScanner for MSBuild 4.2
138Using the .NET Core version of the Scanner for MSBuild
139Default properties file was found at C:\projects\build\SonarQube.Analysis.xml
140Loading analysis properties from C:\projects\build\SonarQube.Analysis.xml
141Pre-processing started.
142Preparing working directories...
14305:54:27.27 05:54:27.265 Unrecognized command line argument: d:sonar.host.url=https://sonarcloud.io
14405:54:27.271 Expecting at least the following command line argument:
145- SonarQube project key
146When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
147- SonarQube project name
148- SonarQube project version
149The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
150Use '/?' or '/h' to see the help message.
15105:54:27.272 Pre-processing failed. Exit code: 1
152Command exited with code 1


Hi i do not understand why dotnet core 2.0 version of scanner is not accepting sonar.host.url
coverage.sh:

if [ -n "$SONARCLOUDTOKEN" ] then dotnet $SONARCLOUD begin \ /key:"build-core" \ /d:"sonar.host.url=https://sonarcloud.io" \ /d:"sonar.coverage.exclusions=Build.Tests/**" /d:"sonar.login=$SONARCLOUDTOKEN" fi

Amaury Leve

unread,
May 28, 2018, 4:51:30 AM5/28/18
to artur.m...@gmail.com, SonarQube
Hi artur,

I just made a test with the following command and it worked properly. 

dotnet "sonar-scanner-msbuild-4.2.0.1214-netcoreapp2.0\SonarScanner.MSBuild.dll" begin /k:ammo-test /d:sonar.host.url=https://sonarcloud.io /d:sonar.login=TOKEN

Could you check you do access SonarCloud without proxy? Also could you make sure you don't have any extra quote.

Cheers,
Amaury
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 
Reply all
Reply to author
Forward
0 new messages