失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 分布式项目Maven打包出现Could not resolve dependencies for project Could not find artifact问题解决

分布式项目Maven打包出现Could not resolve dependencies for project Could not find artifact问题解决

时间:2021-01-29 19:18:14

相关推荐

分布式项目Maven打包出现Could not resolve dependencies for project Could not find artifact问题解决

分布式项目中会用到多模块,就会形成父子工程,需要模块之间的依赖

我的模块分布式如下:

├── common--公共资源模块├── base--返回类、编码枚举类├── config --公共配置├── domain --数据库映射对象├── repository--持久层接口├── service --业务层接口 ├── impl --实体类 ├── utils--工具 ├── student--学生模块├── repository--持久层接口,继承公共模块持久层接口├── service --业务层接口,继承公共模块业务层接口├── impl --实体类├── teacher--教师模块├── repository--持久层接口,继承公共模块持久层接口├── service --业务层接口,继承公共模块业务层接口在student、teacher模块中要依赖common模块但是最近发现一个问题,虽然项目的各个模块能够运行,但是打包时却出现:[ERROR]Failedtoexecutegoalonprojectxxxx-student:Couldnotresolvedependenciesforprojectcom.xxxx:xxxx-student:jar:1.0-SNAPSHOT:Couldnotfindartifactcom.xxxx:xxxx-common:jar:1.0-SNAPSHOT->[Help1]而后我又试了一下在root模块下clean再install,但是同样出现该问题解决方案在common模块的pom文件下添加一行<packaging>jar</packaging>

再在common模块下重新clean,install,确保本地仓库生成其jar包

重新再在root模块下clean,install,成功!

如果觉得《分布式项目Maven打包出现Could not resolve dependencies for project Could not find artifact问题解决》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。