AgileArchitect / MSBuild.SonarQube.Runner.Tool

MIT License
7 stars 12 forks source link

Sequence contains more than one matching element #21

Closed lbensch closed 1 year ago

lbensch commented 1 year ago

I'm using MSBuild.SonarQube.Runner.Tool via Cake.Sonar, apparently the latest version uses a deprecated parameter to get the list of QualityProfiles, projectKey. Is a new version planned?

begin /d:sonar.host.url="https://sonarqube.cgm.ag/" /k:"cgm.fr.axisante.Hydra" /d:sonar.qualitygate.wait="true" /d:sonar.login="[REDACTED]" /d:sonar.password="[REDACTED]" /d:sonar.verbose=true SonarScanner for MSBuild 4.8 Using the .NET Core version of the Scanner for MSBuild Default properties file was found at C:\Developments\products\axisante5\tools\MSBuild.SonarQube.Runner.Tool.4.8.0\tools\sonar-scanner-msbuild-4.8.0.12008-netcoreapp3.0\SonarQube.Analysis.xml Loading analysis properties from C:\Developments\products\axisante5\tools\MSBuild.SonarQube.Runner.Tool.4.8.0\tools\sonar-scanner-msbuild-4.8.0.12008-netcoreapp3.0\SonarQube.Analysis.xml sonar.verbose=true was specified - setting the log verbosity to 'Debug' Pre-processing started. Preparing working directories... Using environment variables to determine the download directory... 11:57:29.022 11:57:29.017 Loading analysis properties from C:\Developments\products\axisante5\tools\MSBuild.SonarQube.Runner.Tool.4.8.0\tools\sonar-scanner-msbuild-4.8.0.12008-netcoreapp3.0\SonarQube.Analysis.xml 11:57:29.023 11:57:29.022 sonar.verbose=true was specified - setting the log verbosity to 'Debug' 11:57:29.027 Updating build integration targets... 11:57:29.03 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore 11:57:29.03 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\10.0\Microsoft.Common.targets\ImportBefore 11:57:29.031 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\11.0\Microsoft.Common.targets\ImportBefore 11:57:29.032 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore 11:57:29.032 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore 11:57:29.033 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore 11:57:29.033 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\Laurent.Bensch\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore 11:57:29.035 Installed SonarQube.Integration.targets to C:\Developments\products\axisante5.sonarqube\bin\targets 11:57:29.035 Creating config and output folders... 11:57:29.036 Creating directory: C:\Developments\products\axisante5.sonarqube\conf 11:57:29.037 Creating directory: C:\Developments\products\axisante5.sonarqube\out 11:57:29.044 Fetching analysis configuration settings... 11:57:29.045 Downloading from https://sonarqube.cgm.ag/api/server/version... 11:57:29.468 Fetching properties for project 'cgm.fr.axisante.Hydra' from https://sonarqube.cgm.ag/api/settings/values?component=cgm.fr.axisante.Hydra... 11:57:29.469 Downloading from https://sonarqube.cgm.ag/api/settings/values?component=cgm.fr.axisante.Hydra... 11:57:30.165 Downloading from https://sonarqube.cgm.ag/api/languages/list... 11:57:30.546 Fetching quality profile for project 'cgm.fr.axisante.Hydra' from https://sonarqube.cgm.ag/api/qualityprofiles/search?projectKey=cgm.fr.axisante.Hydra... 11:57:30.549 Downloading from https://sonarqube.cgm.ag/api/qualityprofiles/search?projectKey=cgm.fr.axisante.Hydra... 11:57:31.472 Failed to request and parse 'https://sonarqube.cgm.ag/api/qualityprofiles/search?projectKey=cgm.fr.axisante.Hydra': Sequence contains more than one matching element Unhandled exception. System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException() at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate) at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass6_0.b__0() at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func1 op, String url, Action1 onError) at SonarScanner.MSBuild.PreProcessor.SonarWebService.TryGetQualityProfile(String projectKey, String projectBranch, String organization, String language, String& qualityProfileKey) at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary2& serverSettings, List1& analyzersSettings) at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings) at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args) at SonarScanner.MSBuild.BootstrapperClass.PreProcess() at SonarScanner.MSBuild.BootstrapperClass.Execute() at SonarScanner.MSBuild.Program.Execute(String[] args, ILogger logger) at SonarScanner.MSBuild.Program.Execute(String[] args, Boolean showDeprecatedWarning) at SonarScanner.MSBuild.Program.Main(String[] args)

lbensch commented 1 year ago

I found my problem, sorry.