dependencies { implementation 'org.springframework.boot:spring-boot-starter' implementation 'org.springframework.boot:spring-boot-autoconfigure' } @Configuration public class MyLibraryAutoConfigure { } @ConfigurationProperties("mylibrary") public class MyLibraryProperties { private boolean enableFeatureA = true; private String featureB = "default value"; } @Configuration @EnableConfigurationProperties(MyLibraryProperties.class) public class MyLibraryAutoConfigure { } mylibrary.enableFeatureA=false mylibrary.featureB=custom value


上一篇:
下一篇:
切换中文