简体   繁体   中英

Spring Boot Properties Migrator

I'm trying to run an application(spring boot v1.5.9.0) with dependency:

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

and getting this error:

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

this error, apparently, did not occur before. How do I make the migrator work?

Do I have to change the spring-boot version to 2x before running the migrator? If so, i don't really get the migrator usage. As its scope is runtime - I have to make the app run before including it - which means I have to solve all the errors without migrator's advice? What do I use it for afterwards?

You've stated that you're running spring boot v1.5.9.0

It doesn't make sense to run the properties migrator with spring boot 1.5.x. Its primary intention is to "assist" in properties migrations that have changed during migration of spring boot 1.x to spring boot 2.x

As for the error, this specific class is available only since spring boot 2.0. See the comment @since in the sourcefile

In your project, application.properties or application.yml is present or not? Spring boot is auto-configuration . I think those properties will be expecting..Also check what are the annotations used in Spring boot main class..Share that Spring boot main class as well..will check

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM