Sonar Quality Gates Plugin throwing numberFormatException

499 Views Asked by At

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!

1

There are 1 best solutions below

0
On

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.