Spring use environment variable in @Value clause.
@Bean public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); } @Value("${RESOURCE_URL}") private String url;