I have a Spring Boot application, generated by JHipster.
Am trying to add some new properties to the application-dev.yml file but my class is seeing the values null, even after spending some hours with Google.
Added the following to the top of application-dev.yml:
host: 1.2.3.4
port: 5555
In my class I have
@Component
public class ExampleUtils {
@Value("${host}")
private String host;
@Value("${port}")
private String port;
}
The class is in a new directory under the source root.
Thanks in advance.
in your application.properties set
spring.profiles.active=dev
or when you run the application parse the command line args follows
-Dspring.profiles.active=dev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With