Exclusion of java files in a sonar message through Jenkins

I launch a sonar from Jenkins. I want to exclude some java files in a sonar report. Is this possible through Jenkins? If so, how can I do this?

+6
java jenkins sonarqube
Jan 13 2018-12-12T00:
source share
3 answers

Assuming you are using the jenkins sonar plugin, refer to this documentation on how to configure the plugin to specify additional parameters that exclude files from analysis.

+8
Jan 13 2018-12-12T00:
source share

Just pass the "sonar.exclusions" property to your assembly (for example, using the JVM argument "-Dsonar.exclusions = ** / Foo.java").

+7
Jan 29 2018-12-12T00:
source share
  • Go to the sonar section of your jenkins work.
  • Click on advanced.
  • In the Additional properties, put or add:
    -Dsonar.exclusions=com/company/packageA/generated/**/*.java,com/company/packageB/generated/**/*.java
  • Save changes.

Notice how you can specify multiple packages with commas.

+2
Mar 28 '14 at 20:14
source share



All Articles