spring-boot-utils icon indicating copy to clipboard operation
spring-boot-utils copied to clipboard

Spring boot 1 and spring boot 2 compatible utils.

Spring boot 1 and spring boot 2 compatible utils.

Search the latest version in the cnetral repository : Search

<dependency>
    <groupId>io.github.hengyunabc</groupId>
    <artifactId>spring-boot-utils</artifactId>
    <version>$version</version>
</dependency>

Conditional Annotation

  • @ConditionalOnSpringBoot1
  • @ConditionalOnSpringBoot2

BinderUtils

org.springframework.boot.bind.RelaxedDataBinder only exists in spring boot 1.

org.springframework.boot.context.properties.bind.Binder on exists in spring boot 2.

BinderUtils support both spring boot 1 and spring boot 2.

TestConfig testConfig = BinderUtils.bind(environment, "ttt", TestConfig.class);