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.
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
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.