Skip to content
Ameen Abozaid
In reviewJNR-002-L08

Demo: untangling a dependency conflict with dependency:tree

  • Lesson 8 of 8
  • 11 min read
  • Junior
On This Lesson 3 topics

The content for this lesson is written and waiting for review. The outline below shows what it covers. It will be published once it is approved.

In this lesson

find and fix a version conflict. Prepares JNR-002-LAB1.

Draft outline details

Step by step

  1. Show an app that fails at run time with NoSuchMethodError.
  2. Run ./mvnw dependency:tree -Dverbose and search for the library name.
  3. Find that two dependencies request different versions.
  4. Planned mistake: add an exclusion on the wrong dependency, and the error remains. Fix: read the tree again and exclude from the right one, or better, pin the version in dependencyManagement.
  5. Run ./mvnw verify and confirm green.
  6. Write one sentence in the README on the cause.

Check your understanding

Better than an exclusion for a shared library?

Show answer

Pin the version once in dependencyManagement.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.