maven多模块项目打包的时候报错如下:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.xxx.cloud:common:1.0-SNAPSHOT: Could not find artifact com.xxx.cloud:xxx-cloud:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.xxx.cloud:common:1.0-SNAPSHOT (xxx\common\common\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.xxx.cloud:common:1.0-SNAPSHOT: Could not find artifact com.xxx.cloud:xxx-cloud:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

找了很久原因,终于找到,这个是maven多模块项目,之前的做法是将多个模块放父级pom.xml同级下,所以没问题,现在我将模块按功能分成了三大类,放三个目录下,因此pom.xml的模块引用路径需要改一下:

1.父pom.xml引用子级模块时需要增加相对路径:

2.子模块引用parent时,需要增加以下代码(我就是少了这行所以报错,具体路径得看你子模块的pom.xml和父pom.xml差多少层目录,我的是差两层):

<relativePath>../../pom.xml</relativePath>

最新文章

  1. 设计模式(十二):通过ATM取款机来认识“状态模式”(State Pattern)
  2. JS技巧
  3. mui事件绑定和可以用的js dom操作方法
  4. HDU 2117 取(2堆)石子游戏【wzf博弈】
  5. JSP-09-使用EL显示数据
  6. android 读取串口数据的服务
  7. 把sublime添加到右键菜单(转)
  8. Mockito--完整功能介绍(转)
  9. iOS制作Static Library(静态库),实现多工程的连编
  10. tf.contrib.slim add_arg_scope
  11. Matlab调用遗传工具箱复现论文模型求解部分
  12. VS code的疑惑之处
  13. docker之container
  14. UOJ#419. 【集训队作业2018】圆形(格林公式)
  15. C/S模型之命名管道
  16. java的字典排序
  17. 深入php内核,从底层c语言剖析php实现原理
  18. ReactJS表单handleChange
  19. 使用ADB管理Andorid系统软件
  20. 关于Url传递参数

热门文章

  1. 一文讲透CabloyJS全栈框架的来龙去脉
  2. esp-01和esp-01s烧录固件和程序
  3. 解决linux mint内置无线网卡失效问题
  4. 关于CSDN微信登录接口的研究
  5. [信息抽取]基于ERNIE3.0的多对多信息抽取算法:属性关系抽取
  6. python 之匿名函数(lambda)
  7. nuxt之vuex的使用
  8. vue 组件之间传值(父传子,子传父)
  9. 金融科技 DevOps 的最佳实践
  10. JavaScript:类(class)