SonarSource / sonar-scanning-examples

Shows how to use the Scanners
GNU Lesser General Public License v3.0
886 stars 2.19k forks source link

When I run the command, show the result is : Not authorized. #156

Closed xuri422 closed 1 year ago

xuri422 commented 1 year ago

D:\sonar-scanning-examples-master\sonarqube-scanner-gradle\gradle-basic>gradlew.bat -D'sonar.host.url=http://XX.XX.XX.XX:9000' sonar

Task :sonar FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 2s 3 actionable tasks: 1 executed, 2 up-to-date

So, How can I authorized? I have tried to input below in gradle.properties: sonar.login=xxx sonar.password=xxx systemProp.sonar.host.url=http://10.1.7.142:9000

joe-tingsanchali-sonarsource commented 1 year ago

Hello @xuri422 ,

You should either use sonar.token (see https://docs.sonarqube.org/latest/user-guide/user-account/generating-and-using-tokens/) or ensure you have the proper permissions to analyze a project with your login and password.

For further help, please post your logs and what you have tried on [Sonar Community(https://community.sonarsource.com/), not on the issues page of the repository. You will get a better response time there.