Sonarqube not able to find database connection

hi i have a springboot application in which i have written some junit test code i am using postgresql as db.when i do jenkins build i get following error in jenkins build


            Caused by:
            org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.BatchDataSourceScriptDatabaseInitializer]: Factory method 'batchDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
                at app//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
                at app//org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
                ... 107 more

                Caused by:
                java.lang.IllegalStateException: Unable to detect database type
                    at org.springframework.util.Assert.state(Assert.java:76)

i have following line in sonar.gradle

project.tasks[“sonarqube”].dependsOn “jacocoTestReport”

Hey there.

This doesn’t look like an error triggered by the sonarqube task.

If you remove the sonarqube task and still run jacocoTestReport, do you receive the same error?

i used below command

project.tasks[“bootJar”].dependsOn “jacocoTestReport”,“jacocoTestCoverageVerification”

instead of project.tasks[“sonarqube”].dependsOn “jacocoTestReport” then issue doesnt come

And do you actually execute the bootJar task in the scenario where the issue doesn’t come, and do the same tests try to run?