Repository navigation
Description
Removes dependencies that a module declares but does not need, across the Java repositories in the org, with one draft PR per repository, each linked here.
Method
Every module was built and analyzed with three views: the declared dependencies, the bytecode references of main and test classes (jdeps and the pilot-plugin bytecode report, not dependency:analyze), and the verbose dependency tree. A dependency is a candidate only when no bytecode or source references it and the tree shows that it neither pins a version nor serves a kept dependency at runtime.
Each PR is verified from a consumer's side, because a green build inside the reactor cannot see what consumers resolve: a project without a parent depends on the published module, and its dependency:list is compared before and after the change. The PR body carries that diff. A dependency that consumers used to get transitively and no longer get is listed as a compatibility note.
Removals, scope changes and code rewrites go in separate commits.
Wave 1: declared but unreferenced
| Repository | Module | Dependency | Change | Result |
|---|---|---|---|---|
| plexus-compiler | plexus-compiler-eclipse |
plexus-utils |
Narrow to test scope |
Tests pass, consumer diff empty |
| plexus-resources | plexus-xml |
Keep, add a comment | Removal fails the container tests | |
| plexus-compiler | plexus-compiler-manager |
plexus-xml |
Keep, add a comment | Removal fails CompilerManagerTest |
| modello | modello-plugin-jsonschema, modello-plugin-snakeyaml |
plexus-utils |
Remove the redundant declaration; modello-core supplies it |
Tests pass, consumers unchanged |
| modello | modello-test |
plexus-utils |
Keep, add a comment | Without it a consumer resolves plexus-utils 3.6.2 from Sisu Plexus |
| modello | modello-plugin-converters, -dom4j, -jackson, -jdom, -sax, -stax, -xpp3 |
plexus-utils |
Keep | src/test/verifiers sources use FileUtils and IOUtil |
| modello | 14 plugin modules and modello-maven-plugin |
javax.inject |
Declare it; main code uses it and it arrived only through modello-core |
Tests pass, consumers unchanged |
plexus-xml next to plexus-utils 4.x is not a leftover. Sisu Plexus was built against plexus-utils 3.x, which contained the org.codehaus.plexus.util.xml classes, and it reads them when it starts a container. A module that declares plexus-utils 4.x replaces that jar through dependency mediation, so plexus-xml is what supplies those classes. No bytecode in the module references it, which is why bytecode analysis and a source search both report it as unused; only a test that starts a container shows the need. Wave 1 therefore keeps these declarations and records the reason in the POM. codehaus-plexus/plexus-testing#129 supplies the pair from plexus-testing, which covers tests; eclipse-sisu/sisu-project#285 removes the need at the source. Once plexus-testing is released with it, the declarations kept only for the test container can be removed.
Later waves: candidates that need a test run or a decision first
- modello:
jackson-*inmodello-plugin-jacksonandsnakeyamlinmodello-plugin-snakeyamlare referenced only by generated code, so they are candidates fortestscope if the generated-code tests still pass. - modello:
modello-coreshipsslf4j-nopatruntimescope, which gives every consumer an SLF4J binding. - plexus-resources: main code uses only
FileUtilsandIOUtilfromplexus-utils; replacing them withjava.nio.file.Fileswould removeplexus-utilsfrom the module. - plexus-archiver and plexus-io: both are still on
plexus-utils3.x while the other repositories are on 4.x.
Checked and kept
These look unused to bytecode analysis but are deliberate, and each already carries a comment in its POM: guava in plexus-testing and commons-lang3 in plexus-velocity (version overrides), plexus-xml in plexus-compiler-test (classpath for the compiler under test), xz and zstd-jni in plexus-archiver, maven-xml in plexus-xml.
No module still uses @Component, @Requirement, components.xml, plexus-component-annotations, plexus-component-metadata or plexus-container-default.
Pull requests
- Document why plexus-xml is declared plexus-resources#147
- Narrow plexus-utils to test scope in plexus-compiler-eclipse plexus-compiler#556
- Declare javax.inject where it is used and drop two redundant plexus-utils declarations modello#659
- Supply plexus-utils 4.x and plexus-xml to projects that use plexus-testing plexus-testing#129
Activity