0

I'm trying to implement a custom SonarQube plugin which also works fine on my dev machine in Eclipse, but as soon as I deploy it to our SonarQube instance it crashes during runtime with a ClassNotFoundException. The class which it can't find during runtime is ExpressionsHelper, which (as far as I understand it) should be in the sonar-java-plugin-***.jar.

Our SonarQube instance is running version 6.1, the SonarJava plugin is installed in version 4.15.0.12310.

Now to which version(s) should I set which property in my pom.xml so that the configuration on my dev machine matches the available libraries on the SonarQube instances? I've tried setting them to sonar.version=6.1, java.plugin.version=4.15.0.12310 but then I still got the ClassNotFoundException during the scan.

Thanks for your help in advance.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
user3032769
  • 21
  • 1
  • 4

1 Answers1

0

If the class is not part of package starting with : org.sonar.plugins.java.api it won't be found at runtime.

org.sonar.java.checks.helpers.ExpressionHelper is not part of this package and so won't be found at runtime, hence the exception you encounter.

benzonico
  • 10,635
  • 5
  • 42
  • 50
  • Okay - how would I extract the content of a ImportTree.qualifiedIdentifier() ideally then? Do I really have to reimplement the tree traversal? Is there nothing in the API for that? – user3032769 Dec 13 '17 at 17:51
  • As of today you would have to copy paste what is the ExpressionHelper, indeed, we don't provide such utilitities as API. – benzonico Dec 14 '17 at 14:03