我有这个没有依赖管理的 pom:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.domini</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.ejb</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.logica</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.ui</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
</dependencyManagement>
在我的耳朵模块中,我想引用这个依赖项,就像这样:
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.domini</artifactId>
<!-- <version>${project.version}</version>-->
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.ejb</artifactId>
<!-- <type>ejb</type>-->
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.logica</artifactId>
<!-- <version>${project.version}</version>-->
<!-- <type>jar</type>-->
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gpt.ui</artifactId>
<!-- <version>${project.version}</version>-->
<!-- <type>war</type>-->
</dependency>
</dependencies>
但是 maven 告诉我这个错误:项目构建错误:cat.base.gpt:gpt.ui:jar 的 'dependencies.dependency.version' 丢失。
那么,为什么我需要指定两倍的版本?这没有任何意义,我做错了什么?