-1

I am attempting to write an extension to the SonarQube checkstyle plugin. I would like to use dependency injection to wire required dependencies. From what I can see (documentation seems to be lacking) SonarQube uses plexus as its IoC container. In my custom plugin I have added the necessary dependencies to generate a plexus components file (confirmed packaged in the plugin jar at "/META-INF/plexus/components.xml"). However when I start the server it issues an error stating dependencies can't be found:

org.picocontainer.injectors.AbstractInjector$UnsatisfiableDependenciesException:
foo.SonarCheckstyleRuleRepository has unsatisfied dependency 'interface foo.MyInterface'
for constructor 'public foo.SonarCheckstyleRuleRepository(
    foo.MyInterface,foo.DifferentInterface)'...

Is there additional configuration required in the plugin (outside of the components.xml) to register the components within the SonarQube server? Do I need to package the plexus classworlds library with the plugin? Is there something additional required to integrate with "pico container"?

M. Jessup
  • 8,153
  • 1
  • 29
  • 29

1 Answers1

0

SonarQube does not use Plexus, it uses PicoContainer.

  • Is there documentation or tutorials how to properly leverage the PicoContainer in the context of writing custom sonarqube plugins? – M. Jessup Feb 25 '15 at 14:08
  • Everything we have is available at http://redirect.sonarsource.com/doc/extension-guide.html. Or you can also read the source code of our many open-source plugins: https://github.com/SonarCommunity/ – Fabrice - SonarSource Team Feb 25 '15 at 15:07