gpt4 book ai didi

maven - 在Maven中,如何从特定依赖项中排除所有传递性依赖项?

转载 作者:行者123 更新时间:2023-12-03 12:57:04 24 4
gpt4 key购买 nike

我想从一个依赖项中排除所有传递性依赖项。在某些地方,我已经看到它建议为此使用通配符

<dependency>
<groupId>myParentPackage</groupId>
<artifactId>myParentProject</artifactId>
<version>1.00.000</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>


当我这样做时,我得到一个警告:

'dependencies.dependency.exclusions.exclusion.groupId' for myParentPackage:myParentProject:jar with value '*' does not match a valid id pattern. @ line 146, column 30


声明本身就是成功的:在我的构建中,可传递依赖项确实被忽略了。

我还发现了一个旧功能请求,该请求确实请求 exactly this feature

所以现在我不知道这是否是我不应该使用的不推荐使用的功能,如果警告是错误的,或者该功能尚未完全实现(我正在使用Maven 3.0.4)...有人对此有更多了解吗?

最佳答案

这是Maven 3.2.1-see 'Transitive dependency excludes' section in the release notes中受支持的功能。

关于maven - 在Maven中,如何从特定依赖项中排除所有传递性依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16354273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com