我有一个包含几个模块的 maven 项目。在 Eclipse (Juno,使用 m2e)中,它似乎编译得很好。但是当我在其中一个模块上进行 maven 安装时,构建会立即失败。
家长绒球:
<groupId>com.sw.system4</groupId>
<artifactId>system4-parent</artifactId>
<version>${system4.version}</version>
<packaging>pom</packaging>
<name>System 4 Parent Project</name>
<modules>
<module>system4-data</module>
...others...
</modules>
<properties>
<system4.version>0.0.1-SNAPSHOT</system4.version>
<spring.version>3.2.3.RELEASE</spring.version>
... others...
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<scope>runtime</scope>
</dependency>
... lots of others ...
</dependencies>
</dependencyManagement>
儿童彩球:
<parent>
<groupId>com.sw.system4</groupId>
<artifactId>system4-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>system4-data</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>runtime</scope>
</dependency>
... lots of others...
</dependencies>
在构建时,我得到以下输出:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.sw.system4:system4-data:0.0.1-SNAPSHOT (C:\work\eclips
e_workspaces\systemiv\system4-parent\system4-data\pom.xml) has 8 errors
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-cor
e:jar is missing. @ line 16, column 16
... others omitted for clarity ...
我不明白为什么它甚至不尝试编译。我试过从父代和子代中删除运行时作用域,但是没有什么区别。救命啊!