[英]Excluding nested transitive dependency in maven
My project depends on jparsec
, which depends on cglib
, which depends on asm
. 我的项目依赖于jparsec
,它取决于cglib
,它依赖于asm
。 My project also directly depends on asm
, but a newer version than the one cglib
depends on: 我的项目也直接依赖于asm
,但是比cglib
更新的版本取决于:
It seems I cannot exclude asm
from my jparsec
dependency. 似乎我不能从我的jparsec
依赖项中排除asm
。 When I attempt to exclude it with Eclipse, it makes no change to my pom. 当我尝试用Eclipse排除它时,它对我的pom没有任何改变。 If I manually exlude it, it has no effect. 如果我手动排除它,它没有任何效果。
Is my only option here to exclude cglib
from jparsec
and then to manually add a dependency on cglib
with asm
excluded? 这是我唯一的选择,从jparsec
排除cglib
然后手动添加依赖于cglib
与asm
排除? This seems a bit convoluted to me, but it does work. 这对我来说似乎有点费解,但确实有效。
I would have expected that if you put asm
before jparsec
in your POM, no exclusion would be required. 我本来期望,如果你把asm
之前jparsec
在你的POM,将不需要排斥。 The Maven "nearest definition" behaviour would kick in to ensure only 4.1
is used. Maven “最接近的定义”行为将启动以确保仅使用4.1
。
As per my comment, you have 2 options to solve this issue: 根据我的评论,您有2个选项来解决此问题:
cglib
from jparsec
and add cglib
with asm
excluded. 您建议的那个,例如从jparsec
排除cglib
并添加带有asm
cglib
。 asm
dependency above the jparsec
dependency. 在jparsec
依赖项之上找到您的asm
依赖jparsec
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.