verify maven managed dependencies

1.2k views Asked by At

maven allows you to define in pom file:

(A) dependencies -> the actual direct dependencies of the project

(B) dependencyManagement/dependencies -> managed dependencies that affect dependencies of category (A) with undefined version and transitive dependencies.

  • If I put wrong/unknown artifact on category A - maven will surely fail.
  • If I put wrong/unknown artifact on category B - maven will fail only if it affects category A (for instance, A defines dep on foo:bar and B defines dep on foo:bar:<unknown-version>.

I wonder if there is any existing plugin that will allow me to verify all managed deps (category B) - make sure they actually exist.

I have 1 global pom project with deps management that serves multiple projects and I want to verify any change to the deps in the CI before uploading new version to remote repository

1

There are 1 answers

0
scrutari On BEST ANSWER

In maven dependency plugin there is goal dependency:analyze-dep-mgt. You may use it to check dependencies in dependencyManagement section of your pom.xml. If you need deeper control or more functionality, options would be to create your own plugin or have a dummy project which would use all your managed dependencies (although I should say this is a cumbersome solution).