Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
183 views
in Technique[技术] by (71.8m points)

sonar-maven-plugin:3.1.1:sonar analyze error after upgrade to SonarQube 6.0

We just upgraded to SQ 6.0 and now some projects get the following error when analyzing with maven:

[INFO] --- sonar-maven-plugin:3.1.1:sonar (default-cli) @ gitlab-hook-dispatcher ---
[INFO] User cache: C:Usersfrank.jakop.sonarcache
[INFO] Load global repositories
[INFO] Load global repositories (done) | time=94ms
[INFO] User cache: C:Usersfrank.jakop.sonarcache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=5ms
[INFO] SonarQube version: 6.0
[INFO] Default locale: "de_DE", source code encoding: "UTF-8"
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=162ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=1ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=73ms
[INFO] Load active rules
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.419 s
[INFO] Finished at: 2016-09-14T08:29:20+02:00
[INFO] Final Memory: 67M/495M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar (default-cli) on project gitlab-hook-dispatcher: Unable to load component class org.sonar.scanner.report.ActiveRulesPublisher: Unable to load component interface org.sonar.api.batch.rule.ActiveRules: NullPointerException -> [Help 1]

Last part of trace is

Caused by: java.lang.NullPointerException
    at org.sonar.scanner.rule.DefaultActiveRulesLoader.readPage(DefaultActiveRulesLoader.java:99)
    at org.sonar.scanner.rule.DefaultActiveRulesLoader.load(DefaultActiveRulesLoader.java:59)
    at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:102)
    at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:63)
    at org.sonar.scanner.rule.ActiveRulesProvider.provide(ActiveRulesProvider.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
    at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
    at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
    at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
    at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
    at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:67)
    ... 72 more

This happens also when we use org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar and seems to be project specific, some projects work and some don't.

Can anyone provide a hint what's wrong here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Credit to @teryk-sonarsource-team, just making it an answer:

  1. Delete the directory data/es in your SonarQube installation.
  2. Restart SonarQube.

It will recompute all the ES indexes.

This resolved the problem for me in SonarQube 5.6.3.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...