1) 克隆这个 repo https://github.com/spring-guides/gs-spring-boot
2)导航到完整目录并运行
./mvnw spring-boot:run
您将能够导航到http://localhost:8080/以查看来自 Spring Boot 的问候。这正如预期的那样。
3) 现在,让我们将 pom.xml 中的 spring-boot 版本从 2.2.2 更新到 2.2.6。
<version>2.2.6.RELEASE</version>
试试.\mvnw spring-boot:run
Tomcat不上来了。出于同样的原因,http 端点不起作用。我在这个版本升级中缺少什么?
正如@Stephane Nicoll 指出的那样,我查看了日志以查找这些错误。
[ERROR] 读取错误/Users/testUser/.m2/repository/org/springframework/spring-web/5.2.5.RELEASE/spring-web-5.2.5.RELEASE.jar;无效的 LOC 标头(错误的签名)
[ERROR] 读取/Users/testUser/.m2/repository/org/assertj/assertj-core/3.13.2/assertj-core-3.13.2.jar时出错;无效的 LOC 标头(错误的签名)
[ERROR] 读取错误/Users/testUser/.m2/repository/net/bytebuddy/byte-buddy/1.10.8/byte-buddy-1.10.8.jar;无效的 LOC 标头(错误的签名)
我清除了 .m2/repository/ 目录,随后下载的工作正常。
谢谢斯蒂芬。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句