1

I know there is an option to ignoreAnnotations in the CPD CLI reference guide but I can't seem to get this to work using maven pmd:cpd plugin. When I view the mvn pmd page it doesn't list 'ignoreAnnotations' as a usable parameter but seems like it should support if can do through CLI no??

I tried in pom like this

            <configuration>
                <ignoreAnnotations>true</ignoreAnnotations>             
            </configuration>

Thanks

  • The feature is indeed unsupported by the Maven plugin. You can submit an issue on https://issues.apache.org/jira/projects/MPMD/issues asking for it to be included in upcoming versions. – Johnco Sep 22 '18 at 02:08
  • That sucks. Do you know if I can add separate configurations inside executions for CPD and PMD. I might try to exclude my endpoint classes from CPD checking as thats where most of my annotations are but I don't want to exclude them from full PMD, only CPD. – dean0bambin0 Sep 26 '18 at 10:35
  • As with any Maven plugin, you can define multiple , each with it's own target, phase and configuration – Johnco Sep 26 '18 at 17:32
  • Yeah I tried with separate executions and configuration inside each but seemed to have no impact. Resulting build still found cpd issues inside endpoints. I noticed all examples have one configuration outside executions. – dean0bambin0 Sep 27 '18 at 18:09
  • I created https://issues.apache.org/jira/browse/MPMD-272 to support `ignoreAnnotations`. – adangel Oct 03 '18 at 09:17

1 Answers1

0

Update, 2019:

maven-pmd-plugin version 3.11.0 added the ignoreAnnotations configuration option.

See plugin documentation: http://maven.apache.org/plugins/maven-pmd-plugin/cpd-mojo.html#ignoreAnnotations

Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103