微服务 springboot 启动成功后没有注册到注册中心

  最近产品系统架构上在向Spring Cloud架构转型,设计到项目结构上的一些调整。今天有个同事遇到了这样的问题:

springboot微服务启动成功了,注册中心地址什么的也都配置好了,但是在注册中心nacos上没有查看到对应的服务实例,

排查了半天,发现是该微服务没有引入spring-web依赖,该依赖被抽出来移到其它包下了。

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>    

  但是没有spring-web依赖居然也能保持启动,这个需要另外研究一下。

posted @ 2020-12-23 14:54  寻找的路上  阅读(3053)  评论(0编辑  收藏  举报