Skip to content

refactor(dependencies): move guava out of root <dependencies> into opt-in dependencyManagement #7608

Closed

Description

@Aias00

Summary

The root pom.xml force-inherits com.google.guava:guava (compile scope) into every reactor module via the top-level <dependencies> block, even modules that never use it.

Evidence

  • pom.xml:610 opens the root <dependencies> block.
  • pom.xml:612-620 declares com.google.guava:guava (with com.google.re2j:re2j exclusion) inside that global block, alongside slf4j-api / jcl-over-slf4j / junit-jupiter / junit-vintage.
  • Guava is the only non-logging / non-test compile dependency globally inherited here; it is not universally required.

Side effect: global inheritance bloats every module's classpath with Guava's (large) transitive tree and masks dependency:analyze "unused declared" warnings for modules that don't actually need it.

Action

  1. Remove the guava <dependency> from root <dependencies> (pom.xml:611-620).
  2. Keep guava centralized in root <dependencyManagement> (pom.xml:329-333) so the version stays managed.
  3. Add an explicit <dependency>com.google.guava:guava</dependency> (version managed) only to the modules that actually import com.google.common.* (typically shenyu-admin, shenyu-common — verify with git grep com.google.common).
  4. Per affected module, run mvn dependency:analyze to confirm no "Used undeclared" regressions after the change.

Acceptance

  • No module inherits guava unintentionally.
  • Explicit guava dependencies exist only where used.
  • CI green.

Related

Activity

  1. github-actions commented on Oct 13, 2026

    @github-actions
    Contributor

    👋 Hello @yuluo-yx

    A new issue has been opened by @Aias00:

    Please review when you have time. Thank you! 🙏

  2. yangjj-iso commented on Oct 16, 2026

    @yangjj-iso
    Contributor

    /assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions