gpt4 book ai didi

java - Spring Boot 属性迁移器

转载 作者:行者123 更新时间:2023-12-02 09:15:24 24 4
gpt4 key购买 nike

我正在尝试运行具有依赖项的应用程序(spring boot v1.5.9.0):

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
<scope>runtime</scope>
</dependency>

并收到此错误:

org.springframework.boot.SpringApplication - Application startup failed
java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/source/ConfigurationPropertySources

这个错误显然以前没有发生过。如何让迁移器工作?

在运行迁移器之前,我是否必须将 spring-boot 版本更改为 2x?如果是这样,我真的不明白迁移器的用法。由于它的范围是运行时 - 我必须在包含它之前让应用程序运行 - 这意味着我必须在没有迁移者建议的情况下解决所有错误?之后我用它做什么?

最佳答案

您已声明您正在运行 spring boot v1.5.9.0

使用 Spring Boot 1.5.x 运行属性迁移器没有意义。其主要目的是“协助”从 Spring Boot 1.x 迁移到 Spring Boot 2.x 过程中发生变化的属性迁移

至于错误,这个特定的类仅从 Spring Boot 2.0 开始可用。请参阅 the sourcefile 中的注释 @since

关于java - Spring Boot 属性迁移器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59032355/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com