maven模块下解决 spring cloud 项目中spring cloud子module的pom文件添加依赖,出现unknown问题

1 问题描述

spring cloud项目,一般都是父项目中有多个子服务,也就是子module模块。

我这里有一个子模块 tizzy-sb

在这里插入图片描述
但子模块和父模块jar 版本都是unkonwn

在父项目中引用了常用的jar包,例如,引入了spring boot的依赖,那么在子项目中引入jar包 未指定version,所以下载下来的jar包都是unknown的

2 解决办法

在父模块下添加 Spring cloud 统一管理依赖

      <dependencyManagement>
          <dependencies>
              <dependency>
                  <groupId>org.springframework.cloud</groupId>
                  <artifactId>spring-cloud-dependencies</artifactId>
                  <version>Greenwich.RELEASE</version>
                  <type>pom</type>
                  <scope>import</scope>
              </dependency>
          </dependencies>
      </dependencyManagement>

然后重新下载刷新maven

在这里插入图片描述

发布了241 篇原创文章 · 获赞 66 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/weixin_38361347/article/details/103642462