Autowired properities class

1. Properties类

@ConfigurationProperties(locations = "classpath:build.properties")

@JsonInclude(value = JsonInclude.Include.NON_EMPTY)

@JsonPropertyOrder(alphabetic = true)

public class BuildProperties {

@JsonInclude(value = JsonInclude.Include.NON_EMPTY)

@JsonPropertyOrder(alphabetic = true)

public static class Versions {

private String app;

private String spring;

private String springBoot;

private String hibernate;

private String angularjs;

private String bootstrap;

private String highcharts;

...

}

2. 配置类

@Configuration

@EnableConfigurationProperties(BuildProperties.class)

public class PropertiesConfig {

}

上一篇:Redmine管理项目2-邮件通知


下一篇:深入浅出RxJava(一:基础篇)