简体   繁体   中英

SonarQube analysis works in IDE but not in Jenkins Pipeline

Which versions am I using (SonarQube, Scanner, Plugin, and any relevant extension):

  • SonarQube 7.9.1 (on a remote server)
  • Sonar maven plugin 3.7.0.1746 (in my pom.xml file)
  • Jenkins 2.222.1 (local server)
  • Maven 3.6.0

What am I trying to achieve:

I want to perform an analysis with a Jenkins Pipeline with my remote server

What have I tried so far to achieve this:

I have succeed to do an analysis with my IDE (intelliJ) and it works with the command:

mvn -B sonar:sonar

After that, the server note the last analysis with the Quality Gate. Nevertheless, it does not work with my Jenkins Pipeline.

I do not understand why it works with the IDE and not with Jenkins.

I have put in my pom.xml a sonar.login which is a specific user token. This user has the right to execute an analysis on this particular project. In my ~/.m2/settings.xml , I have put the sonar.host.url .

I also tried to set up manually a SonarQube server in Jenkins (in system configuration). I put there the url and my token thanks to a secret text but it does not work to.

I have also generated a Webhook but this is for the qualitygate variable in the pipeline and I don't think it matters here.

I don't know what to test now… Any idea? Thanks

It is ok now: I have added on a sonar installer in the settings. In addition I move the sonar.host.url from ~/.m2/settings.xml to my pom.xml file.

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