Skip to content
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

Boot LS JAR size #1436

Closed
BoykoAlex opened this issue Dec 11, 2024 · 4 comments
Closed

Boot LS JAR size #1436

BoykoAlex opened this issue Dec 11, 2024 · 4 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode status: needs-investigation type: enhancement

Comments

@BoykoAlex
Copy link
Contributor

The size of the exploded Boot LS JAR is getting larger with every release due to many OpenRewrite libs chained to one another via the runtime scope dependencies.

There are libs such as rewrite-csharp, rewrite-kotlin, rewrite-jenkins that hardly have any use in the STS context.

Most of these libs are pulled via rewrite-staticanalysis which goes via rewrite-spring directly or rewrite-migrate-java.

@BoykoAlex BoykoAlex added this to the 4.28.0.RELEASE milestone Dec 11, 2024
@BoykoAlex BoykoAlex self-assigned this Dec 11, 2024
@martinlippert martinlippert added status: needs-investigation for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode and removed status: waiting-for-triage labels Dec 11, 2024
@BoykoAlex
Copy link
Contributor Author

My quick investigation revealed that we can exclude rewrite-static-analysis at the expense of:

  • 3 recipes from upgrade to Java 17 gone:
    • Instanceof pattern matching ((a instancof A) -> (a instanceof A b))
    • Text blocks
    • Add Serial annotation to serial version UID
  • 1 recipe for Java 21
    • Replace deprecated java.lang.Runtime methods
  • Copy recipe org.openrewrite.staticanalysis.RemoveUnneededBlock into rewrite commons same named package to get around compile dependency from rewrite-spring on rewrite-static-analysis

Then I can safely exclude rewrite-static-analysis dependency on our side and the LS JAR then is 193.85 MB from 271Mb which is not bad at all.

The problem would arise later, however, if more recipes from rewrite-static-analysis are re-used in rewrite-spring either directly in Java code (compile dependency) or in YAML files (runtime dependency)

@BoykoAlex
Copy link
Contributor Author

Opened an issue against OpenRewrite: openrewrite/rewrite-spring#648

@BoykoAlex
Copy link
Contributor Author

BoykoAlex commented Jan 20, 2025

@martinlippert shall we try to push those changes in? Or shall we wait and see what to do with OR integration first?
I'm inclined to wait and see what we do with OR integration first post license change... then address the JAR size issue if it still an issue.

@BoykoAlex
Copy link
Contributor Author

We are down to 207 Mb JAR with these changes: 1c64204. Not 193.85Mb that I got initially... Wonder if excluded Rewrite's github-actions, jenkins and lombok at the time. Anyway, I stopped at this and digest this change for a bit before excluding more OR libs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode status: needs-investigation type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants