micronaut-projects / micronaut-build

Common Gradle build scripts
Apache License 2.0
18 stars 14 forks source link

Add support for inferred managed libraries #692

Closed melix closed 5 months ago

melix commented 5 months ago

This commit introduces support for "inferred" managed dependencies. Such dependencies are dependencies that we want to be managed, but are not directly handled by a BOM that we import: the only thing we know is that they appear in the dependency graph as a transitive.

For example, we may want to manage opentest4j which is a transitive dependency of junit, but the junit BOM says nothing about it.

In order to determine what version to use, we create a synthetic dependency graph which includes all dependencies that we have inlined in the catalog, and resolve that configuration. Then we search into the resolution result for the version of the libraries that we want a version to be inferred.