Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar
(default-cli) on project dotoyo_form_parent: Unable to execute SonarQube: Fail to parse
entry in bootstrap index: <!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="/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"><link
rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"><link rel="apple-
touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"><link rel="apple-touch-icon"
sizes="76x76" href="/apple-touch-icon-76x76.png"><link rel="apple-touch-icon"
sizes="114x114" href="/apple-touch-icon-114x114.png"><link rel="apple-touch-icon"
sizes="120x120" href="/apple-touch-icon-120x120.png"><link rel="apple-touch-icon"
sizes="144x144" href="/apple-touch-icon-144x144.png"><link rel="apple-touch-icon"
sizes="152x152" href="/apple-touch-icon-152x152.png"><link rel="apple-touch-icon"
sizes="180x180" href="/apple-touch-icon-180x180.png"><link rel="icon" type="image/x-icon"
href="/favicon.ico"><meta name="application-name" content="SonarQube"/><meta
name="msapplication-TileColor" content="#FFFFFF"/><meta name="msapplication-TileImage"
content="/mstile-512x512.png"/><link href="/css/sonar.3398ab84.css" rel="stylesheet">
<title>SonarQube</title></head><body><div id="content"><div class="global-loading"><i
class="spinner global-loading-spinner"></i> <span class="global-loading-text">Loading...
</span></div></div><script>window.baseUrl=""</script><script src="/js/vendor.c4ad594b.js">
</script><script src="/js/app.3398ab84.js"></script></body></html> -> [Help 1]
环境:
jdk8+windows7 64 bit + maven3.2 + SonarQube 6.75
现象:通过maven扫描本地代码时,运行 mvn clean install sonar:sonar 时,出现 Fail to parse entry in bootstrap index,非常的绝望,各种找不到解决方法。
解决:
修改maven的 setting.xml中关于SonarQube连接的配置文件;
将 原 <sonar.host.url>http://localhost:9000/sonar</sonar.host.url> 改成
<sonar.host.url>http://localhost:9000</sonar.host.url> 即可!
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Example for MySQL-->
<sonar.jdbc.url>jdbc:mysql://192.168.1.24:3306/sonarqube?useUnicode=true&characterEncoding=utf8</sonar.jdbc.url>
<sonar.jdbc.username>root</sonar.jdbc.username>
<sonar.jdbc.password>123456</sonar.jdbc.password>
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
另外执行的时候,还可能遇到其他问题,可能是插件 和 SonarQube 版本不兼容导致的,需要仔细排查;
如下是官方给出的解释:
从maven-sonar-plugin 3.4.0.905中,不再支持SonarQube < 5.6。
如果在5.6之前使用SonarQube实例,应该使用maven-sonar-plugin 3.3.0.603。
Maven -sonar-plugin 3.1不再支持Maven < 3.0。
如果在3.0之前使用Maven,应该使用Maven -sonar-plugin 3.0.2。
仅供备份!