gpt4 book ai didi

java - 在 Maven 中,它的 "org.apache.commons.collections:commons-collections"与 "commons-collections:commons-collections"相同吗?

转载 作者:行者123 更新时间:2023-12-01 10:16:16 25 4
gpt4 key购买 nike

我刚刚在我的 pom 文件中看到 Apache commons-collections 有两个不同的组 ID:

<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>

还有这个:

<dependency>
<groupId>org.apache.commons.collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>

这两个是一样的吗?如果它们相同,那么按照惯例应该使用哪一个?

最佳答案

对于 commons-collections 版本 3,没有 groupId:org.apache.commons.collections,因此在版本 4 之前使用:

<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>

自版本 4 起:

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>

请注意, Artifact ID 已更改为 commons-collections4

引用:https://issues.apache.org/jira/browse/COLLECTIONS-382

关于java - 在 Maven 中,它的 "org.apache.commons.collections:commons-collections"与 "commons-collections:commons-collections"相同吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35873279/

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