-
Notifications
You must be signed in to change notification settings - Fork 84
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
Load spring-security-web
dependency from resources
#519
Conversation
@timtebeek The nightly
I traced it back to the I think we should investigate which Spring dependencies we have on the classpath and which ones we need to load from resources and then adjust the recipes accordingly. To investigate this I reproduced it with the CLI and attached with the debugger (with breakpoint on |
Thanks for the tough work of debugging and pinpointing the issue; do I understand correctly you'd like me to take over to apply this pattern at scale across this repository to switch from dependencies on the classpath to dependencies taken from resources? |
@timtebeek That wasn't really my intention, but I would appreciate if you could do that. I just noticed in today's flagship recipe repo run that the error was gone, which is how I remembered this PR. By the looks of it you've already addressed the issue. Thanks for that! Possibly we can give some more thought to how we can avoid this type of issue in the future. The problem, as far as I can tell, is that we in recipe repos sometimes have |
Good to hear the error's gone! And no problem picking this up; I wanted to see this fixed too. :) As for how to prevent this in the future; hard to say what's best; we could build another check into the test framework we have, or add a recipe to |
Would it be too bold to simply remove the In recipe code, the set of dependencies which would both be on the production classpath and also would likely be used in a recipe seems quite small, and this couples the version of the jar used by the recipe execution to the version of the jar which injects type metadata, which could drift and create subtle issues over time. In test code, this mechanism is useful (especially in Such as: JavaParser.fromJavaVersion().classpathSupplier(ClasspathSuppliers.fromResources("spring-web"))
// ClasspathSuppliers published in rewrite-java
JavaParser.fromJavaVersion().classpathSupplier(TestClasspathSuppliers.fromClasspath("spring-web"))
// TestClasspathSuppliers published in rewrite-test
// Though having something specific to java in rewrite-test might shift the current dependency model...
// maybe rewrite-java could be a compile-only dependency of rewrite-test? |
No description provided.