Upload generated classes for analysis and code coverage

Hi there,

I have a java based gradle project. I am using Sonarqube plugin to upload various sources and classes. SCM is git. Jacoco is code coverage tool for the project.
There are lots of generated classes in my project those are being embedded in actual libraries. My integration tests are covering them. All generated classes are residing in a separate directory other than my cloning directory.
I tried to submitting all those to Sonarqube but I am getting a warning like
File 'C:\work\main-build\..\ServerSettingsResult.java' is ignored. It is not located in project basedir 'C:\work\main'.

Here is the sonar properties those I have used.

    property "sonar.projectBaseDir", "C:\work\main"
    property "sonar.java.binaries", classDirs.asPath
    property "sonar.sources", relativePaths.join(',')
    property "sonar.java.coveragePlugin", "jacoco"
    property "sonar.coverage.jacoco.xmlReportPaths",
      "../reports/jacoco/xml/aggregetedReport.xml"
    property "sonar.sourceEncoding", "UTF-8"
    property "sonar.scm.disabled", "true"

As a developer, I should be knowing quality of my generated code because those are being shipped in libraries. Is there anyway to submit those omitted classes to Sonarqube?

I am using Sonarqube - Community Edition - Version 8.9.10 (build 61524).

Best,
Jemin

Hey there.

Generated Code is automatically filtered out of analysis based on annotations, as developers are typically not empowered to touch generated code. What will you do if an issue gets raised on it?

Your version is also past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

8.9.10 → 9.9.5 → 10.5.1 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.