1

I have several sets of libraries. For example:

  • Core 1.0
  • Core 1.5
  • Web 1.0 (uses Core 1.0)
  • Drawing 1.0 (uses Core 1.5)

My problem arises when I have a project that uses both the Web and Drawing libraries. I hard-code the version number of the Core library in a dependencyManagement section of my project, and update it from time to time. I want to make sure that if a newer version of Core is used by Web or Drawing, that I update the version number in dependencyManagement.

versions:display-dependency-updates tells me if there are any new versions of Core available, but I don't want to update to a newer version unless Web or Drawing requires it.

Is there a way to determine if dependencies require newer versions of other dependencies than my project is using?

Thanks.

Jon Onstott
  • 12,491
  • 15
  • 77
  • 128
  • http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency Or mvn versions:use-latest-versions – ianpojman May 03 '12 at 16:32
  • I don't want to upgrade to the latest version of a transitive dependency if the dependency doesn't use the latest version. I want highest version being actively used. – Jon Onstott May 03 '12 at 16:38
  • maven automatically does this when resolving dependencies - you can look in the dependency-tree output to see which are 'version managed' up to the newer version – ianpojman May 03 '12 at 17:09

1 Answers1

1

You can use mvn -Dverbose dependency:tree to see dependency hierarchy and it will also show you version conflicts like you've described.

Also can use mvn versions:display-dependency-updates to see updated dependencies.

Eugene Kuleshov
  • 30,122
  • 5
  • 61
  • 63