解决启动eureka报错Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
再学习Eureka中报了上面的错误是因为SpringBoot和SpringCloud的版本不兼容
截至2022-5-27最新版的切合版本应该是:
SpringBoot 2.7.0 和SpringCloud 2021.0.2
<!-- spring cloud 依赖 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2021.0.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Spring boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
注意!!!!!!!!!
如果你报错记得将
<scope>provided</scope> ======改成 <scope>import</scope>