springboot 实现配置文件给常量赋值

@Component
@ConfigurationProperties(prefix = "task.cron")
public class TaskCronParam implements InitializingBean {
	private String testCron;

	public static String TEST_CRON;

	@Override
	public void afterPropertiesSet() throws Exception {
		TEST_CRON =testCron;
	}
}
原文地址:https://www.cnblogs.com/zhucww/p/10578848.html