verify maven managed dependencies

orshachar :

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

scrutari :

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).

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=463079&siteId=1