Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align error message for missing project key with error message for missing organization, when the settings file is provided #2120

Open
andrei-epure-sonarsource opened this issue Jul 29, 2024 · 0 comments

Comments

@andrei-epure-sonarsource
Copy link
Contributor

If I run

 dotnet-sonarscanner "begin" "/s:C:\workspace\external\net8-console\SonarQube.Analysis.xml" "/d:sonar.token=foo"

and the file contains:

<?xml version="1.0" encoding="utf-8" ?>
<SonarQubeAnalysisProperties
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
  <Property Name="sonar.verbose">true</Property>
  <Property Name="sonar.host.url">https://sonarcloud.io</Property>
  <Property Name="sonar.projectKey">myorg_myproj</Property>
  <Property Name="sonar.organization">myorg</Property>
  <Property Name="sonar.projectName">MYPROJ</Property>
</SonarQubeAnalysisProperties>

I get the following error when not passing the /k command line argument:

07:59:34.867 Expecting at least the following command line argument:

  • SonarQube/SonarCloud project key
    The 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.

And if I pass /k via command line but don't pass /o, the error message is:

sonar.organization parameter has been detected in the provided SonarQube.Analysis.xml config file. Please pass it in the command line instead, using /o: flag.

This is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants