Is it possible to control order of resolution from Spring Environment from underlying PropertySources?
For example.
I have OS environment variable
ENV key=os
and run java with System environment variable
java -Dkey=system
What the output of Invoking method m on bean of class A? How to change order of scanning SystemEnvironmentPropertySource or MapPropertySource [name='systemProperties']?
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import javax.inject.Inject;
@Component
class A{
@Inject
private Environment environment;
public void m(){
System.out.println(environment.getProperty("key"));
}
}