'Override env properties in spring project

We have a java project which is not on spring boot.

Its a normal spring project (spring version 4.1.4) and we have a lot of values defined under the spring bean annotated function, using the @Value annotation.

I am required to override those properties using a property file without having to tinker with the java class. Could you please help me understand, how can I achieve that?

I understand in Spring Boot projects we can do that using "spring.config.location" cmd argument but that will not work here I assume?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source