maven 多模块项目打包遇到的坑

妖狐艹你老母 2022-10-02 00:56 247阅读 0赞

用eclipse建立了一个多模块的maven项目,项目结构如下
web模块中引入了service模块依赖。
在这里插入图片描述
要对child-web模块打包的时候出现了异常:
在这里插入图片描述
关键的错误信息是:
Failed to execute goal on project child-web: Could not resolve dependencies for project com.czx:child-
web:war:1.0: Failure to find com.czx:child-service:jar:1.0 in https://repo.maven.apache.org/maven2 was cached
in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

初步猜测出是缺少了service模块的jar包。
于是我将service模块的jar包添加到本地仓库,再次将web模块打包,依然报出这个错误
从网上找了几个解决方案试了下,最后可行的方法:

  1. parent工程,也就是packagepom的那个工程先install一下

发表评论

表情:
评论列表 (有 0 条评论,247人围观)

还没有评论,来说两句吧...

相关阅读