How to get Spring boot to load external properties for Groovy? Need something similar to java mechanism (application.properties in resources and ConfigBean with @Value annotations)?
When trying to use the same mechanism as with java, I don't know how to annotate the ConfigBean
@Component
public class ConfigBean {
@Value("${seleniumAddress}")
private String seleniumAddress; ...
and then in application.properties
seleniumAddress=http://localhost:4444/wd/hub
but with groovy I cannot annotate the field with @Value("${seleniumAddress}"
It throws an error complaining about "${}" - this is a special sequence in groovy.
So what mechanism should I use here?
Thank you
If you use "${}" for Spring placeholders in Groovy you have to make sure it's a String (not a GString): i.e. use '${}' (single quotes).
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