I have a Maven BOM (bill of materials) for a rather large project that contains several hundred dependencies within the <dependencyManagement>
block. I'd like to verify that all of the dependencies can be successfully resolved before publishing it for the rest of my company.
Unfortunately, the command mvn dependency:resolve
(as well as the other dependency
commands like dependency:tree
) only seems to operate on the standard <dependencies>
block but ignores <dependencyManagement>
. Is there some other command I can use to do this?
This is something I also need so I spent couple of hours today to make a plugin that does that. Adding this
<plugin>
<groupId>com.commsen.maven</groupId>
<artifactId>bom-helper-maven-plugin</artifactId>
<version>0.1.0</version>
<executions>
<execution>
<id>resolve</id>
<phase>verify</phase>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>
to the BOM's pom
should make it run during verify
phase and try to resolve each dependency in the dependencyManagement
section.
I tested it with a very large BOM and it seems to get the job done.
That said, it is not very well designed nor configurable. There are probably tons of issues (like for example it does not account for qualifiers) to be fixed and improvements to be made.
Give it a try and if you find it useful in general but wish to do something more or better, please open an issue or better yet, send a pull request ;)