Sonarqube authorization - how to authorize with sonar-maven-plugin when sonar.forceAuthentication is enabled

前端 未结 2 1733
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 01:59

I\'ve got sonarqube 6.5 with default configs. When sonar.forceAuthentication flag is set to false, I can create and analyse project through command given below.

相关标签:
2条回答
  • 2021-01-05 02:32

    Did you set both sonar.login and sonar.password parameters (https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven#AnalyzingwithSonarQubeScannerforMaven-Security) ?

    Note that in recent versions (like SonarQube 6.5), you should use a user token and just set it in the sonar.login parameter: https://docs.sonarqube.org/display/SONAR/User+Token

    0 讨论(0)
  • 2021-01-05 02:48

    This is a minimal command that I use to update Sonar Cube Dashboard for my project,

    mvn clean install  sonar:sonar -Dsonar.host.url=<Server_URL> -Dsonar.login=<Token_For_Your_User_Id> -Dsonar.projectKey=<It will be calculated by default using group id & artifact id but its advisable that you use a unique string for all users> -Dsonar.projectName=<Descriptive Project Name to show on dashboard> -Dsonar.projectVersion=<if you wish to specify a version number>
    

    You can always wrap a string value in double quotes if it has spaces in it.

    Before using above command, you need to generate token for your user id as specified in answer provided by Eric. There is no need to pass password property.

    0 讨论(0)
提交回复
热议问题