0

Some 3rd party libraries and dependencies are obsolete or outdated in my Maven project. How do I detect which ones are used and which are not? How do I update outdated ones?

I want the unused ones to be deleted and the outdated ones to be updated.

  • I'm not aware of an automated tools for this (and questions seeking that would be off-topic). Go through them one-by-one, remove it, see what breaks in build and runtime. If nothing, leave it removed. Same logic with updating, really, but you'll need to check the maven repository for the later versions if your IDE won't automatically update those indices for you to reference. For example, a google of `maven-dependency-plugin maven` has the second result of `mvnrepository.com`, allowing me to see the latest available version is currently `3.6.0` – Rogue Jul 10 '23 at 13:00
  • If your repository is on GitHub, enable dependabot. – Thorbjørn Ravn Andersen Jul 10 '23 at 17:15

2 Answers2

0

Consider using Dependencies Analysis and Package Search

romanv-jb
  • 201
  • 5
0

For detecting not used dependencies in project you can consider output of:

mvn dependency:analyze

dependency:analyze detects unused dependencies by scanning bytecode of your application, so can happen that some of dependencies used only in runtime will be wrong detected.

But more of detected unused dependencies of should be ok.


For detecting outdated dependencies you can use:

mvn versions:display-dependency-updates 
Slawomir Jaranowski
  • 7,381
  • 3
  • 25
  • 33