How to find where the library is used in multiple pom files

We have several maven projects depending on our own shared libraries.

When we update the library, it would be useful to quickly find out which projects are library dependent (and you may need to use the new version)

Obviously, I can manually look in all pom files or write a script, but this is less than ideal.

Are there any tools that provide this functionality? e.g. hudson plugin, Nexus, artifactory, etc.

EDIT:

Some explanations:

I do not want to update all projects at once. Regression testing and release efforts make this impractical and often unnecessary (even with automated testing and release). I just need a report showing me what projects might be required to update the library ...

Many answers relate to the project itself, noting which version is used. Ideally, the solution will work so that for this library I may ask what it uses. This is similar to what the Nexus problem says below.

Hudson does something similar with maven downstream automated builds. I can consider extending this with the hudson plugin.

+4
source share
5 answers

My search is complete: http://www.sonarsource.org/sonar-2-1-in-screenshots/

Sonar now provides this.

0
source

I know that although it was a good tool for managing pores and banks, Artifactory does not have the function you specify :(

You can check this StackOverflow question: Search for new versions of dependencies

Alternatively, you can check Maven Plugin Versions . Among other things, it allows you to scan project-dependent dependencies and create a report of those dependencies that have newer versions.

+3
source

A fairly common practice is to declare all versions in the dependencyManagemen t of the parent module and reference dependencies without versions everywhere. In this case, you will need to update only one POM.

+1
source

Not quite what you are asking for, but the Dependency Convergence Report may be helpful. Here are some examples .

Update:. I know that I do not quite answer the question with my proposal, but I do it differently (searching for all projects that refer to this artifact) will require collecting all POM all projects, and I do not know about the solution currently offering such Reference function (a corporate repository would be an ideal candidate for implementing this, though).

0
source

I solved this problem using dependency version ranges to automatically retrieve the latest versions.

  <dependency> <groupId>foo.xyzzy</groupId> <artifactId>bar</artifactId> <version>[1.0.0,2.0.0)</version> </dependency> 

It might make sense to use a version range, for example [1.0,) , to include the latest version after 1.0.

The trick for this job is to have developer and prod profiles that enable and exclude snapshot repositories for your shared resources and use hudson to automatically build projects when re-building dependencies.

0
source

Source: https://habr.com/ru/post/1306338/


All Articles