Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“Class Not Found” during SonarQube analyse

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

like image 858
Inforedaster Avatar asked Sep 02 '15 13:09

Inforedaster


People also ask

Does SonarQube need Java 11?

The SonarQube server require Java version 11 and the SonarQube scanners require Java version 11 or 17. SonarQube is able to analyze any kind of Java source files regardless of the version of Java they comply to. We recommend using the Critical Patch Update (CPU) releases.

What is SonarQube error?

There are three types of issues: Bug – A coding mistake that can lead to an error or unexpected behavior at runtime. Vulnerability – A point in your code that's open to attack. Code Smell – A maintainability issue that makes your code confusing and difficult to maintain.


2 Answers

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>
like image 150
user5429174 Avatar answered Sep 20 '22 05:09

user5429174


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.

like image 44
benzonico Avatar answered Sep 22 '22 05:09

benzonico