Circleci Sonarqube integration for gradle project

Trying to integrate circleci with sonarqube, repo is using bitbucket.
Below is the code set for sonar set up and sonar scan.

``` Preformatted text
name: Sonar scan
command: |
# Open ssh tunnel into Sonar
/open-tunnel.sh
# Workaround CircleCi bug : https://discuss.circleci.com/t/git-checkout-of-a-branch-destroys-local-reference-to-master/23781
git branch -D master
# Run scanning job
TASK_URL=$(./gradlew -d sonar -Dsonar.branch.name=$CIRCLE_BRANCH -Dsonar.branch.target=$CIRCLE__TARGET_BRANCH | tee out | grep -Eo ‘http./api/ce/task.’)
# Get result and quality gates
/process_sonar_request.sh $TASK_URL

Its not scanning the repo.

Hi,

Welcome to the community!

You haven’t given much to go by here. What is happening? (i.e. logs)

 
Ann

But I get below error in build.

and at end these errors too

Is above config is fine for sonar scan from circleci?
Could you please help to pipeline success and push to sonar.?

Hi,

From what I can tell of your analysis log screenshots, it seems that there’s an error in your compilation, not your analysis…?

In general, the full log, or at least the full error, presented in code-formatted text (``` on the line before and on the line after) is far preferable to screenshots.

 
Ann

Hi,

The first thing I see here is

Google tells me that JPAAnnotationProcessor has to do with code generation, i.e. a step in the process way before you get to SonarQube analysis. Since with Java, you can only analyze after you’ve compiled, and since I believe this is a pre-compile step, I don’t believe this has anything to do with SonarQube.

Sorry, but I don’t think we can help you here.

 
Ann

Thanks Ann for the reply.
Let me check.

Thanks Ann!. Resolved the above error, but new one come for another repo.

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,....]

Could you help to resolve this?

Hi,

The general rule is one topic, one thread. This is a new question on a new repo. :slightly_smiling_face:

At the same time, I suspect this is not actually an ERROR but a warning? Anyway, that can be dealt with in a new thread with full logs

 
Ann

Thanks Ann!.
I will post new topic. Please reply