您的位置:首页 > 其它

'dependencies.dependency.version' is missing for xxx

2011-03-30 18:30 453 查看
对于多个平行 module 的 maven 项目,为保证所有依赖版本一致,肯定会用到 dependencyManagement。

当阅读了 maven 的说明文档, 将开发中的 flex maven 项目使用此功能按示例编写后,却遇到了 'dependencies.dependency.version' is missing for xxx 的问题。

经多次尝试,原来 maven 对于父项目定义的dependencyManagement 中的 非 jar 类型的 <type></type>节点不会继承,也就是说子项目中必须再次声明非 jar 类型的 <type></type> 即可。

比如 父项目中声明:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>4.0.0.14159</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flexunit</groupId>
<artifactId>flexunit</artifactId>
<version>0.85</version>
<type>swc</type>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>


子项目中再声明一次,如果是jar 则不必要。

<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.flexunit</groupId>
<artifactId>flexunit</artifactId>
<type>swc</type>
</dependency>
</dependencies>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐