15

I have many errors with sonarqube analyse in the Jenkins job with the analyse success

[ERROR] [14:36:44.124] Class not found: org.joda.convert.FromString
[ERROR] [14:36:44.126] Class not found: org.joda.convert.ToString
[ERROR] [14:34:42.441] Class not found: org.apache.commons.logging.Log
[ERROR] [14:34:42.724] Class not found: org.apache.oro.text.perl.Perl5Util
[ERROR] [14:34:31.442] Class not found: io.swagger.annotations.ApiModel
[ERROR] [14:34:31.442] Class not found: io.swagger.annotations.ApiModelProperty
[ERROR] [14:28:37.756] Class not found: org.apache.commons.logging.Log
[ERROR] [14:28:40.030] Class not found: org.apache.oro.text.perl.Perl5Util

SonareQube : 5.1.2

sonarQube jenkins plugin : 2.6

JDK : 1.7

Any help please

thanks

Inforedaster
  • 1,260
  • 1
  • 23
  • 39

3 Answers3

5

Add the following dependency to your pom

<dependency>
    <groupId>org.joda</groupId>
    <artifactId>joda-convert</artifactId>
    <version>1.8.1</version>
    <scope>provided</scope>
</dependency>
  • 5
    That may help in some cases but it is no remedy for the root cause. – Marcel Stör Oct 17 '15 at 12:33
  • Did not work for me. I will try this in the future: http://stackoverflow.com/questions/31593240/class-not-found-error-when-running-sonarrunner – JonyD Mar 21 '17 at 12:12
2

This error is displayed when the .class file of the mentioned class is not found. This might results in less accurate and less precise issues raised.

You should check your analysis configuration and more specifically the sonar.java.libraries property to be sure you provide the correct dependency to your project.

benzonico
  • 10,635
  • 5
  • 42
  • 50
2

The root cause in our case were outdated Sonar plugins. In order to figure out which one it is you need to run a Maven debug build i.e. run it with -X. The

Class not found: org.joda.convert.FromString
Class not found: org.joda.convert.ToString

you'll see if the sonar-jmeter-plugin is not up to date for example.

Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
  • It definitely does. After upgrading from 4.5.x to 5.1.2 (same as OP) we saw the exact same output as the OP. The builds failed because `org.joda.convert` wasn't found. Upgrading the Sonar plugins fixed that. – Marcel Stör Oct 18 '15 at 09:57
  • 1
    This error log is not related to the build failure you mention. – benzonico Oct 18 '15 at 17:41
  • 1
    Updating to the latest sonar-maven-plugin plugin (2.7.1) does not solve the issue. – Jhack Nov 15 '15 at 22:49