SpringCloud多模块项目Maven clean报错 Non-resolvable parent POM for com.imooc:order-common:1.0.1.SNAPSHOT

今天尝试着将原来的项目改为多模块,在项目改造过程中遇到一坑,花了不少时间,最终得以解决。

项目结构:

其中order是父模块,以下的都是子模块,order-common是一些通过信息模块,其他两个子模块对order-common都有依赖,但是在maven clean的时候项目就会有报错提示:

The build could not read 1 project -> [Help 1]
  
  The project com.imooc:order-common:1.0.1.SNAPSHOT (E:\CompanyProject\yunnan\IMOOC\SpringCloudLearn\order\order-common\pom.xml) has 1 error
    Non-resolvable parent POM for com.imooc:order-common:1.0.1.SNAPSHOT: Failure to find com.imooc:order:pom:1.0.1.SNAPSHOT in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of aliyun has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

 网上大多数都是说是子模块找不到父模块,设置<relativePath/>,但是设置后问题仍未能解决。

我注释掉pom中的<parent>再单个的模块的进行clean,order-common模块提示,

'version' uses an unsupported snapshot version format, should be '*-SNAPSHOT' instead. @ line 13, column 12

一看报错,检查下<version>,果然是格式问题<version>1.0.1.SNAPSHOT</version>,修改<version>

<parent>
  <artifactId>order</artifactId>
  <groupId>com.imooc</groupId>
  <version>1.0.1-SNAPSHOT</version>
</parent>

修改后项目clean ,compile , install 都正常。

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值