Repository navigation
Description
Summary
Two Apache Commons dependencies declared in shenyu-admin/pom.xml are effectively dead and should be removed.
Evidence
-
commons-io— declared atshenyu-admin/pom.xml:296-298(<version>${commons-io.version}</version>).
git grep org.apache.commons.ioacrossshenyu-admin/(main and test) returns 0 matches → no source usage. -
commons-collections4— declared atshenyu-admin/pom.xml:186-187. The only two files importingorg.apache.commons.collections4are:shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ApiDocController.javashenyu-admin/src/main/java/org/apache/shenyu/admin/service/manager/impl/DocManagerImpl.java
Both belong to the apidoc viewer that is being removed by [Refactor] Remove dead API-doc viewer (ApiDocController + DOC_DEFINITION_MAP) and keep the live swagger→MCP publish pipeline #7592 / [Bug] API-doc detail endpoint GET /apidoc/getDocItem missing (returns 404) #7593. Once those land, this dependency has no consumer.
Action
commons-iocan be removed independently now (no source usage) — confirm withmvn -pl shenyu-admin dependency:analyze.commons-collections4removal is gated on [Refactor] Remove dead API-doc viewer (ApiDocController + DOC_DEFINITION_MAP) and keep the live swagger→MCP publish pipeline #7592/[Bug] API-doc detail endpoint GET /apidoc/getDocItem missing (returns 404) #7593: after the apidoc viewer is deleted, re-runmvn -pl shenyu-admin dependency:analyzeto confirm it becomes an "Unused declared dependency".- Remove the corresponding
<dependency>blocks fromshenyu-admin/pom.xml. - Drop the now-orphaned
<commons-io.version>property if no other module references it (cross-checkgit grep commons-io.version). Keepcommons-collections4in root<dependencyManagement>only if used elsewhere; otherwise drop.
Acceptance
mvn -pl shenyu-admin dependency:analyzereports neither as unused after cleanup.- Build + CI green.
Related
- [Refactor] Remove dead API-doc viewer (ApiDocController + DOC_DEFINITION_MAP) and keep the live swagger→MCP publish pipeline #7592, [Bug] API-doc detail endpoint GET /apidoc/getDocItem missing (returns 404) #7593 (apidoc removal, gates
commons-collections4) - [Cleanup] Remove the orphaned shenyu-registry-consul module left behind by the Consul externalization #7583 (dependency cleanup umbrella)
Activity
github-actions commentedon Oct 13, 2026
👋 Hello @Aias00
A new issue has been opened by @Aias00:
Please review when you have time. Thank you! 🙏
konlue commentedon Oct 14, 2026
Hi @Aias00, I'd like to take this one. While verifying on master I found the issue's evidence doesn't match the current code (though I may be missing something on my end), so I'd like to confirm a revised scope before sending a PR. All commands below are copy-paste reproducible on master.
1.
commons-iolooks used in shenyu-adminCall site 1 — ClusterForwardFilter.java#L143-L151,
IOUtils.copyat L148:Call site 2 — SandboxServiceImpl.java#L118-L126,
IOUtils.copyat L123:If these two usages are real, removing the
commons-iodependency as-is would break compilation. Would it be acceptable to first replace bothIOUtils.copycalls withorg.springframework.util.StreamUtils.copy(already on the classpath via spring-core, and closer to the coding guideline of preferring project/framework utils), and then remove the dependency block fromshenyu-admin/pom.xml(L295-L299)?2.
commons-collections4is used by 65 files, not 2The two files named in the issue are indeed among them, but so are core listeners/aspect/controller code, e.g. AbstractDataChangedListener.java#L30, HttpLongPollingDataChangedListener.java#L21, WebsocketCollector.java#L22:
first 15 of the 65 importing files
So removing
commons-collections4is not feasible now. And even in the future it wouldn't unlock via the apidoc cleanup: as of writing, #7592 and #7593 are still open — the removal hasn't started (per #7592 it also needs a coordinated removal of the dashboard-side UI, shenyu-dashboard#719, in the same release train) — and even once that lands, 60+ of the 65 usages remain. I'd suggest keepingcommons-collections4and narrowing this issue's scope tocommons-ioonly.3.
<commons-io.version>is not an orphaned propertyIt's referenced by two other modules, so the property must stay; only shenyu-admin's dependency block goes away:
e.g. shenyu-plugin-cryptor/pom.xml#L29-L33 and shenyu-protocol-tcp/pom.xml#L50-L54.
Revised plan
If this scope sounds right, I'll send a PR that: (1) replaces the two
IOUtils.copycall sites withStreamUtils.copy(identical semantics: buffered copy, stream left open for the caller), (2) removes thecommons-iodependency fromshenyu-admin/pom.xmlonly, (3) keeps${commons-io.version}for cryptor/protocol-tcp. Verified withmvn -pl shenyu-admin dependency:analyzeand a green build. Happy to adjust if you'd rather keepcommons-ioand leave the call sites untouched.refactor(admin): drop commons-io by replacing two IOUtils.copy call s…
refactor(admin): drop commons-io by replacing two IOUtils.copy call s…