We are using a spring boot application, where properties are loaded from application.yml
file instead of application.properties
, located at src/main/resources/
which looks like below:
config:
host: localhost:8080
server: 123
And they are being pulled in a .java
file like this
@ConfigurationProperties( prefix="config")
public class ConnectionImpl implements Connection{
@Value("${config.host}")
private Stringhost;
}
I am able to retrieve properties this way.
But we are trying to move the config properties from application.yml
to a different .yml
file which is located at a different location. (src/main/resources/env-config
).
Now I am not able to retrieve properties same way, i.e, using @Value
annotation. Is there any other annotation I need to add ?