I have created a Java library that I want to call from Spring applications. The library has some @Value parameters, which are to be populated from system variables that we pass in to the calling application via -D arguments. In addition, it has an @EnableConfigurationProperties that points to some Autowired configuration beans.
However when I call the library from a consumer application with the appropriate system variables supplied, the Spring @Value parameters do not get populated, and the beans do not get wired; they all come up null.
How can I inject the system variables from the consumer application into the Spring library classes?