Maven transitive dependencies

dependencies are passed

     A-->C B-->A ==>B-->C (this dependency is passed based on the scope of compile)

     In the dependency configuration, if no scope is written, the default is the compile scope, and the transfer of dependencies is mainly for the compile scope

     Dependent scope:

         The test scope means that the test scope is valid, and this dependency will not be used during compilation and packaging

         The compile scope means that the compilation scope is valid, and dependencies are stored in it when compiling and packaging.

         The provided scope means that it is valid in the process of compilation and testing, and will not be added when the war package is finally generated, such as: servlet-api, because web servers such as servlet-api and tomcat already exist, and it will conflict if repackaged

        runtime depends on runtime, not compile time

     dependency conflict

     1. If a depends on version 1.0 of b, c depends on version 1.1 of b, and d depends on a and c, then in the pom of d, whichever dependency is written first, the version with the dependency written first will be used

     2. If a depends on version 1.0 of b, c depends on version 1.1 of b, d depends on a and c, f depends on d and c, and the length of the dependent paths is inconsistent, choose the smallest one.

    3. If you want to accurately control the dependency package, you can use the dependency exclusion function -> exclusions to exclude

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326492190&siteId=291194637