You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unwanted dependencies via rewrite-static-analysis #648
The size of the Spring Boot Language Server JAR has increased quite a bit in the past 6 months. Looks like major contributor to the size of the Boot LS JAR are the OpenRewrite libs.
There are libs such as rewrite-csharp, rewrite-kotlin, rewrite-github-actions, rewrite-jenkins. For example rewrite-csharp is unrelated to Spring at all yet it is still pulled in via the rewrite-static-analysis dependency.
Excluding these dependencies leads to Class Def Not Found Exceptions in rewrite-static-analysis from KotlinFileChecker and similar as well as from rewrite-migrate-javaorg.openrewrite.java.migrate.UpgradeJavaVersion where a class from rewrite-jenkins is used explicitly.
I'd propose to have runtime dependencies rather than compile for:
rewrite-spring -> rewrite-static-analysis. Only needs org.openrewrite.staticanalysis.RemoveUnneededBlock recipe for rewrite-static-analysis. I'd move this recipe in rewrite-java.
rewrite-migrate-java -> rewrite-static-analysis. Attempt to move recipes used from rewrite-static-analysis to rewrite-java as well. Some may move in rewrite-migrate-java such as ReplaceDeprecatedRuntimeExecMethods
rewrite-migrate-java -> rewrite-jenkins. Not sure how to convert this into the runtime dependency but would be nice as well.
The benefit of a runtime dependency would be that composite yaml recipe would miss a recipe rather than fail to load the entire composite recipe. Perhaps there is something else can be done with optional dependencies on Kotlin and C# libs such that recipes in rewrite-static-analysis won't throw exceptions. Please feel free to propose alternative ideas.
hi @BoykoAlex ! Thanks for the initial work into figuring out how we can trim these dependencies down a bit; would indeed be nice to have these be a little more opt in as opposed to ever growing, but we'd also need to re-architect things a bit. For now: know that you've kicked off an internal discussion as well, as we reevaluate and make changes to make this optional.
Activity
timtebeek commentedon Dec 13, 2024
hi @BoykoAlex ! Thanks for the initial work into figuring out how we can trim these dependencies down a bit; would indeed be nice to have these be a little more opt in as opposed to ever growing, but we'd also need to re-architect things a bit. For now: know that you've kicked off an internal discussion as well, as we reevaluate and make changes to make this optional.
timtebeek commentedon Jan 20, 2025
This has been fixed in
providedconfiguration for optional language dependencies rewrite-static-analysis#411Thanks again!