Hosted Gitlab + SonarCloud

  • ALM used: Hosted Gitlab

  • CI system used: Hosted Gitlab

  • Scanner command used when applicable: gradle sonarqube -x testClasses -x test

  • Languages of the repository: Java

  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting):

    Task :sonarqube FAILED
    FAILURE: Build failed with an exception.
    What went wrong:
    Execution failed for task ‘:sonarqube’.
    Please provide compiled classes of your project with property

  • Steps to reproduce - follow basic instructions on to integrate my Hosted Gitlab java project with SonarCloud by modifying my build.gradle and .gitlab-i.yaml files.

I have tried adding the property “”, “**/classes” to the build.gradle sonarqube properties section along with a few other values for the location and nothing works.

When I run this same exact command locally on the same project targeting my locally running sonarqube server, it works just perfectly. Not really sure what is wrong with my configuration to get the Gitlab hosted CI pipeline to work with the Sonarcloud integration.

Anyone have any ideas?

Hi Rob,

I know nothing about Gitlab ALM and Gitlab CI but I work on the java analyzer side that complains about missing property.
So I tried to follow Gitlab and SonarCloud guide to reproducing your problem.
I created a Gitlab project:

I created a SonarCloud account, and add analysis of my project by adding this commit:
The CI is green and I can see the analysis on SonarCloud :smiley::

What is different in your project configuration?