We use the code below to inject Spring beans with properties from a properties file.
This help me:
ApplicationContextUtils.getApplicationContext().getEnvironment()