I have a Maven 2 project and I want to configure my Checkstyle report plugin so that only some of my classes are analysed. I have found the maven.checkstyle.excludes<
If, like me, you arrived here searching for a way to exclude generated sources from checkstyle, do this:
org.apache.maven.plugins
maven-checkstyle-plugin
2.15
${project.build.sourceDirectory}
By default, the checkstyle:checkstyle goal of the checkstyle plugin uses ${project.compileSourceRoots}
, which apparently includes generated source directories.
If you change it to ${project.build.sourceDirectory}
, it will use only the source directory, not any generated source directories.
Note that while
is deprecated, the alternative,
, does not appear to work.