Reputation: 3569
Is it possible to do something like that?
@Value("${xxx.hostname}")
private String hostname;
Is it also possible to get any other System Environment Property like that?
Upvotes: 0
Views: 3620
Reputation: 1720
Spring Boot automatically allow you to take environment variable.
You can just do @Value("${HOSTNAME}")
(if HOSTNAME is defined ofc)
You can also use your application.properties
to have something like :
xxx.hostname = ${HOSTNAME}
Upvotes: 2