I’m using SonarQube 9.3 and the Kotlin Gradle plugin 3.3. This is hosted on a GitLab server and sitting on Linux.
I’ve gone through and configured the SonarQube plugin according to the steps explained on SonarQube server,
This is the output on the GitLab Server with a successful run of SonarQube.
Running with gitlab-runner 13.9.0 (2ebc4dc4)
on docker-02 da50a737
Preparing the "docker" executor
00:01
Using Docker executor with image gradle:jre11-slim ...
Using locally found image version due to "if-not-present" pull policy
Using docker image sha256:3db0f5822fb0a9b133c16a54339f0fce2f173c8defb36db14e2ed809f399763a for gradle:jre11-slim with digest docker.io/gradle@sha256:a46bc1557bdfb12f9a521a75322f70f96704651e32726f1afd6ae702687f6d12 ...
Preparing environment
00:00
Getting source from Git repository
00:22
Fetching changes with git depth set to 999999...
Initialized empty Git repository in /builds/OX/sas/si/.git/
Created fresh repository.
Checking out 3ee2f54c as master...
Updating/initializing submodules recursively...
Submodule 'data-dictionary' (https://gitlab-ci-token:[MASKED]@cl-gitlab.cl.net/OX/sas/data-dictionary.git) registered for path 'data-dictionary'
Cloning into '/builds/OX/sas/si/data-dictionary'...
Submodule path 'data-dictionary': checked out 'fd6c339d3664678be2fe64c8e47e79e378b608fe'
Entering 'data-dictionary'
Restoring cache
00:00
Checking cache for sonarqube-check...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
Downloading artifacts
00:01
Downloading artifacts for compile (8558)...
Downloading artifacts from coordinator... ok id=8558 responseStatus=200 OK token=gGyMnso7
Executing "step_script" stage of the job script
00:00
Using docker image sha256:3db0f5822fb0a9b133c16a54339f0fce2f173c8defb36db14e2ed809f399763a for gradle:jre11-slim with digest docker.io/gradle@sha256:a46bc1557bdfb12f9a521a75322f70f96704651e32726f1afd6ae702687f6d12 ...
$ exit
Saving cache for successful job
00:01
Creating cache sonarqube-check...
.sonar/cache: found 1 matching files and directories
Archive is up to date!
Created cache
Cleaning up file based variables
00:00
Job succeeded
However, when I try to see the output of the scan, I see nothing. It just has the project’s 4 configuration steps completed and the spinning circle with the words “Waiting for the first analysis to come in…”
I don’t really see any errors in the GitLab results. And I don’t know what a good run looks like. I did verify that I am using the correct SONAR_TOKEN. I generated the environment variable for GitLab twice, and I have synced that with the GitLab server. The above output is with sonarqube running in debug mode. I’m not sure what else to check. It did tell me to set the url variable for 127.0.0.1, but I thought that
Based on the logs, it looks like the sonarqube task never runs at all.
What happens when you run gradle sonarqube -d locally in the siBackEnd_VM/si folder?
Any particular reason you add the -d option (which runs it as a daemon) to gradle sonarqube but not your other gradle tasks?
You may also find it useful to add more verbose logging to your gradle comand (--info, ‘–debug’) to understand what’s happening (or not) when Gradle runs.
I used the -d which I saw it was for debug, but I also tried --debug and --full-stacktrace. I got the same information that I reported previously.
As for trying to run that command, I’m pretty sure I tried running it on the GitLab runner with no results in finding the files on there anymore. I’ll double check.