Skip to content

Remove unused declared dependencies, suppress false positive for guice - #556

Merged
elharo merged 1 commit into
apache:masterfrom
elharo:master
Jul 23, 2026
Merged

elharo merged 1 commit into
apache:masterfrom
elharo:master

Conversation

@elharo

@elharo elharo commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

mvn dependency:analyze reports 4 unused declared dependencies. Three are genuinely unused and can be removed. The fourth (guice) is a false positive required by the test harness.

Changes

Removed (3):

  • maven-api-xml:provided β€” no code references; already transitive via maven-api-core
  • maven-xml:provided β€” no code references; already transitive via maven-testing
  • maven-core:test β€” no code references; already transitive via maven-testing

Kept with suppression (1):

  • guice:test β€” false positive. Required at test runtime by Eclipse Sisu (used by maven-testing harness for DI). Test-scope transitive deps at provided scope are excluded per Maven's scope table, so guice must be declared explicitly. Added to <ignoredUnusedDeclaredDependencies>.

Verification

  • No imports from any of the 4 packages exist in the project source code
  • Each removed dependency is already available transitively through other declared dependencies
  • guice suppression is scoped to the :classes classifier

@elharo
elharo marked this pull request as draft July 19, 2026 16:08
return jarFile;
} catch (Exception e) {
// TODO: improve error handling
} catch (MavenArchiverException e) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this change is not from this PR. all PRs should start with main

maven-dependency-plugin:analyze reports 4 unused declared dependencies.
Three are genuinely unused and can be removed:

- maven-api-xml (provided): no code references; already transitive via
  maven-api-core
- maven-xml (provided): no code references; already transitive via
  maven-testing
- maven-core (test): no code references; already transitive via
  maven-testing

The fourth, guice (test), is a false positive. It is required at test
runtime by Eclipse Sisu (used by the maven-testing harness for DI).
Test-scope transitive deps at provided scope are excluded per Maven's
scope table, so guice must be declared explicitly. Added it to
ignoredUnusedDeclaredDependencies to suppress the warning.
@elharo
elharo marked this pull request as ready for review July 19, 2026 16:46
@elharo
elharo requested review from CrazyHZM and cstamas July 19, 2026 16:46
@elharo
elharo merged commit 7c80d85 into apache:master Jul 23, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

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

@github-actions github-actions Bot added this to the 4.0.0-beta-2 milestone Jul 23, 2026
@elharo elharo 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