We use the code below to inject Spring beans with properties from a properties file.
How about PropertiesLoaderUtils?
Resource resource = new ClassPathResource("/my.properties"); Properties props = PropertiesLoaderUtils.loadProperties(resource);