我使用此命令仅生成由PR更新的代码的sonnar报告:
sh "mvn -Dsonar.host.url=http://sonarqube:9000\
-Dsonar.analysis.mode=preview\
-Dsonar.github.pullRequest=${env.BRANCH_NAME.substring(3)}\
-Dsonar.github.repository=***********\
-Dsonar.github.login=${env.GH_LOGIN} \
-Dsonar.github.password=${env.GH_PASSWORD} sonar:sonar \
-Dsonar.host.url=http://sonarqube:9000 \
-Dsonar.login=****** \
-Dsonar.password=*******
问题是我有这个堆栈:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project jenkinscraft: Failed to execute project builder:
org.sonar.plugins.github.PullRequestProjectBuilder: This operation requires a credential but none is given to the GitHub constructor
任何想法我如何指定凭证?