我如何阅读Maven依赖树 [英] How do I read a Maven dependency tree
问题描述
我有servlet-api版本2.5,作为pom.xml中提供的范围.这是我的项目的dependency:tree输出的一部分. 从2.3版本管理;从编译范围管理"是什么意思?
I have servlet-api version 2.5 as provided scope in pom.xml. Here is part of the dependency:tree output of my project. What does "version managed from 2.3; scope managed from compile" mean?
[INFO] +- commons-logging:commons-logging:jar:1.1:compile
[INFO] | \- javax.servlet:servlet-api:jar:2.5:provided (version managed from 2.3; scope managed from compile)
这是否意味着在我的类路径上对版本2.3有一些传递性依赖?我的 WAR 文件根本没有servlet-api jar,但是我确实使用了旧版本的春天 2.5.4.我怀疑Spring框架取决于servlet-api 2.3.
Does that mean there is some transitive dependency on version 2.3 on my classpath? My WAR file does not have servlet-api jar at all, but I do use old version of Spring 2.5.4. I suspect the Spring framework depends on servlet-api 2.3.
推荐答案
该消息基本上意味着servlet-api的version
会传递为2.3(因此,在commons-logging的pom中,他们基本上使用版本2.3),但在您的项目中特别要求使用版本2.5,因此就使用了它.
The message basically means that the version
of servlet-api would have transitively been 2.3 (so basically in commons-logging's pom they define servlet-api with version 2.3), but that version 2.5 was specifically asked for in your project, so that is what was used.
范围相同.在commons-logging的pom中,它是用范围compile
定义的,但是您已经用范围provided
定义了它,所以再次使用的是范围.
Same goes for the scope. In commons-logging's pom it is defined with scope compile
, but you have it defined with scope provided
, so again that is the scope that was used.
这篇关于我如何阅读Maven依赖树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!