-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkstyle plugin does not include modules from buildSrc #7425
Comments
This is working as intended, checkstyle is run in an isolated classloader with only the rules that were specified on its own classpath - You can create a subproject for your custom checkstyle rules and add that to the checkstyle classpath. |
@oehme If checkstyle is intended to be running with an isolated classloader why are the build/classes/java/main & build/resources/main directories included by default? Should that be opened as a bug? |
Because Checkstyle needs them to run some of its checks on your code. It's not entirely source code based. If it also looks for rules in there then that would be an odd implementation detail of Checkstyle, but not much we can do about. Checkstyle extensions are supposed to go into the |
@oehme Thanks for the background, I appreciate you taking the time. |
Expected Behavior
When using the checkstyle plugin I would expect that modules from buildSrc are available when checkstyle is executed. Because they are not included any custom checkstyle modules that are compiled via buildSrc are not on the classpath when the checkstyle module executes. This causes the checkstyle module to fail on initialization of the custom module. I would expect that any custom modules from buildSrc are available on the classpath so that they can be referenced via a custom checkstyle configuration.
Current Behavior
The checkstyle module does not include classpath entries for buildSrc jar file.
Context
I am trying to use a custom checkstyle module that is part of my project without including it in the output of the project. I could do this by using a sub project or putting the custom module in the main path but then I would have to manually filter the custom classes out of the generated artifacts. This becomes even more cumbersome in a multi-project build.
Steps to Reproduce (for bugs)
./gradlew check
Your Environment
The text was updated successfully, but these errors were encountered: