Gradle project - Sonarqube Classes not found during the analysis

Hi, gradle project integrated with sonarqube. When building project get below error log

Classes not found during the analysis : [org.openid4java.consumer.ConsumerException, org.openid4java.consumer.ConsumerManager, org.springframework.ldap.core.support.BaseLdapPathContextSource, org.springframework.security.ldap.authentication.BindAuthenticator, org.springframework.security.ldap.authentication.LdapAuthenticationProvider, org.springframework.security.ldap.authentication.LdapAuthenticator, org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator, org.springframework.security.ldap.search.LdapUserSearch, org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator, org.springframework.security.ldap.userdetails.UserDetailsContextMapper, org.springframework.security.oauth2.client.OAuth2AuthorizedClientService, org.springframework.security.oauth2.client.registration.ClientRegistrationRepository, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter, org.springframework.security.openid.AxFetchListFactory, org.springframework.security.openid.OpenIDAuthenticationFilter, org.springframework.security.openid.OpenIDAuthenticationToken, org.springframework.security.openid.OpenIDConsumer]

Please help to resolve the issue?

Hello,
I have added below parameters to build file.

sonarqube {
	properties {
		property "sonar.java.binaries", "build/classes/java/main"
        property "sonar.java.libraries", "lib/*.jar" 
        property "sonar.java.test.binaries", "build/classes/java/test"
        property "sonar.java.test.libraries", "lib/*.jar"   
        property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml"    
	}
}

Then the list in the classes not found reduced. But still it shows below classes not found

Classes not found during the analysis : [com.fasterxml.jackson.annotation.JsonInclude$Include, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.JsonS
erializer, com.fasterxml.jackson.databind.SerializerProvider, javax.persistence.AttributeConverter, javax.persistence.FetchType, javax.persistence.GenerationType, org.spring
framework.data.repository.CrudRepository, org.springframework.data.repository.Repository, org.springframework.hateoas.ResourceSupport]

Could you please help to get rid this error?

Hello,
Could you help me to sort out this issue?
Is this because of any plugin missing in sonar?

Hello,

In order to help you:

  • Can you please provide the version of your SonarQube instance, as well as the version of the SonarSource Java analyzer you are using (you can find this info in the list of installed plugins)?
  • Are you sure you are providing all the jars to your analysis? Some transitive dependencies might not be visible.
  • Are you using the latest version of our Java analyzer?

Cheers,
Michael

version : Version 7.9.1 (build 27448)
As I mentioned above, in sonar properties listing the jar path. Last updated in November 2019.

In some projects when we not giving ‘jar’ file path, there is no warnings of ‘classes not found’ but when we give the path, get almost same classes listed above as ‘classes not found’

Hi Arun,

I’m not sure about what you are trying to achieve by specifying this property:

    property "sonar.java.libraries", "lib/*.jar"

Do you have some additional libraries that you want to add to the ones declared in your build.gradle file, or are you trying to fix a bug in SonarScanner for Gradle about libraries’ definition?

Because, I did a test using SonarQube 7.9.1 (including Java analyzer 5.13.1) Java 11.0.7, Gradle 6.3 and it works fine without adding sonar.java.libraries propetry.