I use some BOM dependencies in my Maven project, such as:
<dependencyManagement>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
...
</dependencyManagement>
Whenever I need to add a dependency, I want to know if that dependency has been declared in any dependencyManagement I imported, so that I don't need to specify version for it.
Now I'm doing that manually, go to the source of those BOM files to check, but sometimes one BOM imports other BOMs as well, for example: spring-boot-dependencies imports netty-bom and jackson-bom. So I want to know is there a way to list(flatten) all my dependencyManagement?
I think the best you can do with maven is mvn help:effective-pom and grep for the dependency in question. It will show you the effective pom, including the expanded BOM dependencyManagement.
Also, if you use an IDE like IntelliJ, it will show an "arrow up" symbol for managed dependencies, including those pulled in via BOM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With