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