-1

Not able to do Sonar Analysis SUCCESSFULLY and didn't get ANALYSIS SUCCESSFUL with URL to browse on SonarQube

Error logs:-

16:19:31  > Task :sonarqube
16:19:31  Reports path not found or is not a directory: /home/xxxxxxxxxx/model/target/surefire-reports
16:19:31  Reports path not found or is not a directory: /home/xxxxxxxxx/store/target/surefire-reports
16:19:42  Classes not found during the analysis : [io.prometheus.client.CollectorRegistry, org.openid4java.consumer.ConsumerException, org.openid4java.consumer.ConsumerManager, org.springframework.security.oauth2.client.OAuth2AuthorizedClientService, org.springframework.security.oauth2.client.registration.ClientRegistration, org.springframework.security.oauth2.client.registration.ClientRegistrationRepository, org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository, 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]
16:19:44  
16:19:44  Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
16:19:44  Use '--warning-mode all' to show the individual deprecation warnings.
16:19:44  See https://docs.gradle.org/5.3.1/userguide/command_line_interface.html#sec:command_line_warnings
16:19:44  
16:19:44  BUILD SUCCESSFUL in 2m 24s
16:19:44  18 actionable tasks: 15 executed, 3 up-to-date

I am using command ./gradlew sonarqube

above builds with java-8-openjdk-amd64

and runs sonar analysis with java-11-openjdk

I tried changing it to Java 8 but got this:-

19:42:10  > Task :sonarqube
19:42:10  SonarScanner will require Java 11 to run starting in SonarQube 8.x

gradle.properties file :-

javaxValidationVersion=2.0.1.Final
systemProp.sonar.host.url=xxxxxxxxxxxxx
swaggerAnnotationsVersion=1.5.22
lombokVersion=1.18.6
jooqVersion=3.11.11
springBootVersion=2.2.0.M4
logstashEncoderVersion=5.3
pgVersion=10
pgDriverVersion=42.2.5
flywayVersion=5.2.4
flywaySpringTestVersion=5.2.1
testContainersVersion=1.11.1
modelMapperVersion=2.3.2
seleniumJavaVersion=3.141.59
commonsLang3Version=3.9
commonsTextVersion=1.6
jschVersion=0.1.55

# Spring boot version overrides
jooq.version=3.11.11

build.gradle file:-

plugins {
    id("net.nemerosa.versioning") version "2.8.2"
    id "org.sonarqube" version "2.7"    
}

allprojects {
    group = "xxxxxx"
    version = versioning.info.full

    repositories {
        jcenter()
        maven { url 'https://repo.spring.io/milestone' }
        maven { url 'xxxxxxxxx' }

    }
}

Let me know if you need more information.

Alin
  • 11
  • 7

1 Answers1

0

In your build.gradle

  • You have not listed out a single dependency. You need to list out all the project dependencies such as Prometheus, openid4java, etc.
  • You also want to configure the various repositories where these artifacts can be found and downloaded from
  • You should configure the surefire plugin. See this example.

You are getting a way too many errors. Resolve them one at a time before trying anything else.

VHS
  • 9,534
  • 3
  • 19
  • 43
  • Thank you, I am sorry i am very new, few questions:- 1. How can i find out all the project dependencies ? 2. Trying to use surefire plugin but using gradle to build the project not maven, how to do that for it ? – Alin May 14 '20 at 15:27
  • If your code uses any non-JDK library, you need to specify it as your project dependency. If you are using a third party library, you should obviously know where to find it too. It can't be that you are using a library but you don't know where to find it. However, if you still don't know where to find the library, you can find it in popular repositories like Maven Central. Off course, you need to configure a repo in your `build.gradle` too. I would suggest you first practice using `Gradle`. – VHS May 14 '20 at 15:42
  • @Alin, were you able to resolve any part of your problem? If you were, please don't forget to accept the answer. – VHS May 16 '20 at 00:48