Skip to content

Manage commons-io via dependencyManagement#562

Merged
ascheman merged 1 commit into
apache:maven-jar-plugin-3.xfrom
aschemaven:commons-io-depmgmt
Jul 23, 2026
Merged

Manage commons-io via dependencyManagement#562
ascheman merged 1 commit into
apache:maven-jar-plugin-3.xfrom
aschemaven:commons-io-depmgmt

Conversation

@ascheman

Copy link
Copy Markdown

The 3.x line declares commons-io:commons-io:2.22.0 as a direct compile dependency although nothing in the code uses it, so every build emits:

[WARNING] Unused declared dependencies found: commons-io:commons-io:jar:2.22.0:compile

The POM comment marks it as a Maven 4.0.0-rc-3-era workaround ("looks like dependencyManagement is not taken into account"). That behaviour is gone: dependencyManagement is honored by current Maven 3 and 4.

Note the pin itself is still required — simply removing the dependency silently downgrades commons-io: org.apache.maven.shared:file-management:3.2.0 → commons-io:2.19.0 wins first-declaration conflict resolution against plexus-archiver:4.12.0 → commons-io:2.22.0 (both depth 2), while plexus-archiver 4.12.0 expects 2.22.0. This PR therefore moves the pin into <dependencyManagement> instead of dropping it.

Verified (found while verifying the 3.5.1 release candidate):

  • dependency:tree -Dincludes=commons-io resolves 2.22.0 with both Maven 3.10.0-rc-1 and Maven 4.0.0-rc-5 — effective classpath unchanged.
  • mvn clean verify -P run-its green on both Maven lines: 38/38 ITs (incl. the toolchain-gated ones), dependency:analyze warning gone.

Dependabot keeps bumping the version in dependencyManagement as before.

The direct commons-io dependency was a Maven 4.0.0-rc-3-era
workaround; it is unused in code and makes dependency:analyze
warn about an unused declared dependency. The pin itself is
still required: without it, file-management's transitive
commons-io 2.19.0 wins conflict resolution against the 2.22.0
that plexus-archiver 4.12.0 expects.

Moving the pin to dependencyManagement keeps the effective
classpath identical (2.22.0 on Maven 3.10.0-rc-1 and 4.0.0-rc-5,
verified via dependency:tree) and silences the warning.
Full -P run-its passes on both Maven lines (38/38 ITs).
@slachiewicz

Copy link
Copy Markdown
Member

how about fix file-managemen ?

@ascheman

Copy link
Copy Markdown
Author

how about fix file-managemen ?

@slachiewicz Good point — the root cause is file-management 3.2.0 still declaring commons-io 2.19.0. I will open a PR on apache/maven-file-management bumping it to 2.22.0. The dependencyManagement here is the interim until a file-management release with that bump is consumable by jar-plugin; it can be dropped again afterwards.

@ascheman

Copy link
Copy Markdown
Author

Correction after checking: file-management master already has commons-io 2.22.0 (dependabot #105, merged 2026-04-24) — v3.2.0 just predates it. So no code PR is needed; what is missing is a file-management release. Until a release with that bump is consumable here, the dependencyManagement in this PR remains the working interim; I would drop it in a follow-up once file-management > 3.2.0 is out.

@ascheman
ascheman merged commit bc28643 into apache:maven-jar-plugin-3.x Jul 23, 2026
17 checks passed
@github-actions github-actions Bot added this to the 3.5.2 milestone Jul 23, 2026
@github-actions

Copy link
Copy Markdown

@ascheman Please assign appropriate label to PR according to the type of change.

@ascheman ascheman added the dependencies Pull requests that update a dependency file label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants