简体   繁体   中英

Sonar Quality Gates Plugin throwing numberFormatException

following the set up as provided in https://github.com/jenkinsci/sonar-quality-gates-plugin , while adding the post-build-step with the project key, I am facing the following error:

>  java.lang.NumberFormatException:For input string: "<!DOCTYPE
> html><html lang="en"><head><meta http-equiv="content-type"
> content="text/html; charset=UTF-8" charset="UTF-8"/><meta
> http-equiv="X-UA-Compatible" content="IE=edge"><link
> rel="apple-touch-icon" href="/sonar/apple-touch-icon"     at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>   at java.lang.Integer.parseInt(Integer.java:580)     .... Caused:
> javax.servlet.ServletException    at
> org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:765)   at
> org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)  at
> org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)    at
> org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
>   ....

SonarQube version: 6.7.2 Jenkins version: 2.105 Sonar Quality Gate Plugin version: 1.3.0

Has anyone faced this error before, or have any idea on what could be going wrong? Thanks!

I had this same issue and the cause was a slash '/' at the end of the SonarQube Server URL.

Issue: “Sonar Quality Gates Plugin throwing numberFormatException” when adding Quality Gate SonarQube plugin to Post-build Actions.

Cause: The SonarQube Server URL in Manage Jenkins >> Configure System >> Quality Gates – SonarQube ends with a slash '/'.

Solution: Remove the slash '/' at the end of the SonarQube Server URL.

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