我有一个具有以下结构的 Maven 项目:
parent (artifactID: ABC)
|
|---- module 1 (artifactID: ***)
|---- module 2 (artifactID: XYZ)
模块 1
可以有 artifactID:ABC
吗?
我的父模块只是为了将模块打包在一起。它没有自己的任何源代码。
Maven 是否考虑模块的层次结构来区分两个模块?如果不是为什么?
区分两个同名但在不同地点的人应该不难。
最佳答案
当groupId
相同时,artifactId
必须不同。
作为专家 docs状态,groupId
必须是全局唯一的,并且 artifactId
在 groupId
内必须是唯一的。
groupId
A universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other projects with a similar name
artifactId
The identifier for this artifact that is unique within the group given by the group ID.
关于java - 模块可以与父模块具有相同的artifactID吗? |梅文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51464197/