I've this code in order to populate my properties:
@Bean
public Properties quartzProperties() throws IOException {
PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
propertiesFactoryBean.setLocation(new ClassPathResource("/quartz.properties"));
propertiesFactoryBean.afterPropertiesSet();
return propertiesFactoryBean.getObject();
}
quartz.properties
is like:
org.quartz.jobStore.host = localhost
The problem is that according to current environtment (loc, dev...), I need this property is one or another.
We are looking for a way to parameterize this value. Something like:
org.quartz.jobStore.host = ${jobHost}
where, jobHost
would contain the environment related host.
I hope I've explained so well.
Any ideas?
EDIT
I've tried setting my jobHost
variable on commandline:
mvn clean package spring-boot:run -Dspring-boot.run.arguments=--spring.config.additional-location=scheduler-props.properties,--jobHost=localhost
but it gets me:
java.net.UnknownHostException: ${jobHost}
it seems jobHost
is not resolved.