1. Maven relies on principles

    1. A > B > C and A > E > F > D > C, the former is preferred
    2. Declare first: If the path length is the same, then declare first.
  2. Maven has A transitive dependency mechanism. If A depends on B and A dependency is introduced, Mave will be introduced along with B when resolving A.

    • A > B > C > G21 guava (20.0)
    • E > > F the G20 guava (21.0)

    Assuming pom introduced A and E, maven can introduce guava 20.0 rather than G21, when the program is called G21 new method or class, will run out of A ClassNotFoundException/NoSuchMethodError

  3. screening

    1. If it can be found, there may be a JAR conflict. If it cannot be found, there may be a missing JAR package, which can be introduced.
    2. Use MVN dependency:tree [-DVERBOSE -DIncludes =groupId:artifactId], or the DIEA plugin Maven Helper to view the dependency tree
    3. Check to see if the version in the lookup class is the same as the version in the Maven dependency
  4. The sample error: under Caused by: Java. Lang. NoClassDefFoundError: Org/springframework/core/env/EnvironmentCapable find classes, exist, conflict jars, reference of spring – the core 4.2.2

Looking at the dependency tree, Spring-Core3.0.7 was introduced, which is inconsistent with the class version

Find the conflict POM and add Exclusion