To exclude the generated code from sonar analysis

2019-04-22 14:17发布

问题:

The generated code is present in a separate target folder path like: target/generated-sources/fod1/fod2/*.java

I have been trying several option but in vain please help.

<properties>
    <sonar.exclusions>**/generatedsources/fod1/fod2/**/*.java</sonar.exclusions>
</properties>

I have tried the option from one of the posts also **/*generated*

回答1:

See the documentation in the General Settings > Exclusions page. The pattern file:**/generated-sources/** will do the job if you're not using a too old version of SonarQube.



回答2:

On SonarQube 5.4, the exclusions for duplications are on General Settings > Analysis Scope, on the Duplications tab



标签: sonarqube