Skip to content

Boot LS JAR size #1436

Closed
Closed

Description

@BoykoAlex

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.

Activity

  1. added this to the 4.28.0.RELEASE milestone on Dec 11, 2024
  2. self-assigned this
    on Dec 11, 2024
  3. added
    for: eclipse
    for: vscode
    and removed on Dec 11, 2024
  4. BoykoAlex commented on Dec 11, 2024

    @BoykoAlex
    ContributorAuthor

    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)

  5. BoykoAlex commented on Dec 11, 2024

    @BoykoAlex
    ContributorAuthor

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

  6. BoykoAlex commented on Jan 20, 2025

    @BoykoAlex
    ContributorAuthor

    @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.

  7. BoykoAlex commented on Jan 22, 2025

    @BoykoAlex
    ContributorAuthor

    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

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodestatus: needs-investigationtype: enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions