Le 28/01/2026 à 00:34, Adam Kaplan a écrit :

Unfortunately obtaining a complete dependency tree a-priori in Maven is
exceptionally hard, and perhaps impossible in the general case. Many
plugins dynamically fetch dependencies for the sake of developer
convenience - even the Surefire plugin does this as a feature [4]!

That situation may change with more widespread use of Java Modules in the ecosystem. We are working hard for making that much easier in Maven 4 than it was before. The dependency tree can be obtained from the `module-info.class` file. Standard API `java.lang.module.ModuleDescriptor` and `java.lang.module.ModuleFinder` help a lot in this task. Maven become less relevant in this context, because no matter what Maven dependencies said, it will be ignored by the JVM if not declared directly or transitively in `module-info` or via `--add-read` options. Looking at Maven configuration would be needed only if, after building the dependency tree, we want complementary information such as version numbers (when not declared in the `module-info`) and from which repository the dependency was downloaded.

    Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to