In Spring Core change the PropertySourcesPlaceholderConfigurer class can be initialized as a part of Configuration and then @Value("${RESOURCE_URL}") annotation can be used to access environment variables.
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
@Value("${RESOURCE_URL}")
private String url;