Skip to content

Remove orphan entries from Gradle version catalog#4325

Open
janhoy wants to merge 1 commit intoapache:mainfrom
janhoy:cleanup/prune-orphan-deps
Open

Remove orphan entries from Gradle version catalog#4325
janhoy wants to merge 1 commit intoapache:mainfrom
janhoy:cleanup/prune-orphan-deps

Conversation

@janhoy
Copy link
Copy Markdown
Contributor

@janhoy janhoy commented Apr 23, 2026

Prunes 7 library entries and 3 version keys from gradle/libs.versions.toml that are dead weight: not referenced in any build file and not present in any resolved dependency graph (verified against all 37 Gradle lock files).

No JAR is added to or removed from the shipped distribution.

One benefit other than cleanup is that renovatebot won't have to bother upgrading stuff we don't use :)

What was removed

Entry Type Reason
prometheus-simpleclient + prometheus-simpleclient-httpserver library + version key Old Prometheus Java client (io.prometheus:simpleclient), fully superseded by io.prometheus:prometheus-metrics-* which is already in use
junit-jupiter library + version key The aggregate artifact org.junit.jupiter:junit-jupiter:6.0.3 is not used; junit-jupiter-api:5.6.2 still arrives transitively via randomizedtesting and is unaffected
apache-commons-configuration2 library + version key Not in any dependency tree
apache-curator-recipes library only curator-client and curator-framework are used; curator-recipes is not
apache-log4j-jul library only The JUL-to-Log4j bridge is not loaded anywhere in the runtime graph
dropwizard-metrics-servlets (metrics-jakarta-servlets) library only Only dropwizard-metrics-core and metrics-jetty12-ee10 are used

Remove 7 library entries and 3 version keys that are neither referenced
in any build file nor present in any resolved dependency graph (verified
against all Gradle lock files):

Libraries removed:
- prometheus-simpleclient / prometheus-simpleclient-httpserver
  (old Prometheus Java client, superseded by prometheus-metrics-*)
- junit-jupiter aggregate (org.junit.jupiter:junit-jupiter v6.0.3;
  junit-jupiter-api v5.6.2 still arrives transitively via randomizedtesting)
- apache-commons-configuration2
- apache-curator-recipes
- apache-log4j-jul
- dropwizard-metrics-servlets (metrics-jakarta-servlets)

Version keys removed (exclusive to the above libraries):
- prometheus-simpleclient
- junit-jupiter
- apache-commons-configuration2

All 28 @keep transitive-alignment entries were verified against lock files
and confirmed still needed; they are unchanged.
@janhoy janhoy requested a review from malliaridis April 23, 2026 10:20
@github-actions github-actions Bot added dependencies Dependency upgrades tool:build labels Apr 23, 2026
@janhoy janhoy requested a review from dsmiley April 23, 2026 10:20
@epugh
Copy link
Copy Markdown
Contributor

epugh commented Apr 23, 2026

How did you figure this out? Someday I bet we have a whole set of prompts that are part of our build that are "Go look for this issue and tell me if you see it" ;-). It would be nice if some of these types of things just were part of our tooling or docs ;-). I love what you are doing with prompts etc around build tooling.

Copy link
Copy Markdown
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dsmiley
Copy link
Copy Markdown
Contributor

dsmiley commented Apr 23, 2026

I suspect @HoustonPutman added curator-recipes speculatively. It's a shame we only still only use curator for the base framework since the real gold there is the recipes.
Any way, +1 to remove what we don't actually use. Thanks for this.

@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented Apr 23, 2026

How did you figure this out? Someday I bet we have a whole set of prompts that are part of our build

I have another PR to add some prompts in dev-docs/. I could share the prompt I used here as well. Claude spent perhaps 10 mins resolving and cross checking all deps with the gradle lock files. I’m sure we could ask AI to build us a py script that does the same job in 30 seconds…

Edit: Here's the prompt I used:

Make a feature branch from main. Then identify orphan entries in our libs.versions.toml. I.e. libs that we track version of but is never used, either directly or transitively (or by reflection) in the code base. And prune those you find and attempt a compile and 'gradlew check -x test' to see if they are truly not needed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants