Closed Andrew-Stubbs closed 6 years ago
Hi, Are you sur for :
mvn sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID
Because error message say : Unable found project for highways-england/cars-service
$CI_PROJECT_ID=highways-england/cars-service ? It's impossible, gitlab get a number
Sorry @gabrie-allaigre , you are correct, I have been playing with calling the integration locally as well as via gitlab while trying to diagnose the problem.
Two outputs directly from GitLab: Failing:
$ mvn compile sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID
20501 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project cars-service: Failed to execute project builder: com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder: Unable found project for 184 Verify Configuration sonar.gitlab.project_id or sonar.gitlab.user_token access project -> [Help 1]
Succeeding:
$ mvn compile sonar:sonar -Dsonar.gitlab.user_token=$GITLAB_TOKEN -Dsonar.host.url=$SONAR_URL -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID
Ok thanks,
Are you sur save 2 times user_token in admin. There was a bug in sonar 7.0 with password fields
You're a lifesaver, thanks @gabrie-allaigre
The problem does seem to be that I never actually saved the Gitlab User Token, despite it looking like I had.
Apologies for wasting your time with user error!
This seems to be the same issue experienced by @vuza in this closed issue: https://github.com/gabrie-allaigre/sonar-gitlab-plugin/issues/89#issuecomment-385245321
I have added a GitLab User Token within
When I run my jobs from GitLab with the following command:
I see the following error message:
However when I use this command (Specifying the same user token as I already added to the SonarQube settings):
The project builds and receives comments from SonarQube as expected.
Why does the global setting not seem to be being applied (I am using plugin v3.0.1)?
Thanks.