gmshake commented on PR #76: URL: https://github.com/apache/maven-checkstyle-plugin/pull/76#issuecomment-1127140853
> Does the effect not will be the same as we will use for default: > > ``` > project.build.sourceDirectory > project.build.testSourceDirectory > ``` > > without special filtering ... Not exactly. In my team we have many projects specify the `sourceDirectories` as we have JPA annotation processors and OpenAPI tools to generate REST API stubs. It is a burden we specify it now and then, so it will be perfectly that the default setting works OOB. I had tried to change `sourceDirectories` default to `project.build.sourceDirectory` but it breaks https://issues.apache.org/jira/browse/MCHECKSTYLE-70 as some users use build-helper-maven-plugin to inject source directories to the build. It looks that the best solution is excluding generated sources / test-sources from the build (project.compileSourceRoots / project.testCompileSourceRoots) before sending them to checkstyle. It will be perfect that Maven core provide some API like `getGeneratedCompileSourceRoots / getGeneratedTestCompileSourceRoots` but apparently it will not go for 3.6.x and earlier versions (3.0.x, 3.3.x) . Since the generated sources / test-sources should be in build target directory we can bravely exclude the entire build target directory. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
