简体   繁体   中英

Do Jenkins and SonarQube need to be on the same machine?

I am trying to run a SonarQube scan from Jenkins job. I have the SonarQube Scanner for Jenkins plugin installed v2.6.1 running on local Jenkins (for dev only);

I have seen conflicting reports on whether or not you can run SonarQube on a different server then Jenkins. It wouldn't make sense if you could not do that... if you can, instructions on how to accomplish it would be great. Simply putting in the URL to the SQ server where Jenkins expects a directory to Sonar Runner locally, does not work.

Jenkins and SonarQube do not have to be on the same machine.

The SonarQube plugin in Jenkins will run one of these three scanners:

  • SonarQube Scanner
  • SonarQube Scanner for Maven
  • SonarQube Scanner for MsBuild

Depending on which scanner you use, it works a bit differently:

  • For the SonarQube Scanner, pass -Dsonar.host.url=http://your.host:1234 as additional arguments. (or add it to your sonar.properties file)

  • For the SonarQube Scanner for Maven, add -Dsonar.host.url=http://your.host:1234 to your maven build step .

  • For the SonarQube Scanner for MsBuild, add /d:sonar.host.url=http://your.host:1234 to your MsBuild.exe call.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM