I need to specify an optional jvm argument as in:
@PropertySource({ "${config.file:classpath:config-file.properties}" })
But it doesn't works because of the second ":
".
Can someone help me ?
Context: Spring 3.12.
I need to specify an optional jvm argument as in:
@PropertySource({ "${config.file:classpath:config-file.properties}" })
But it doesn't works because of the second ":
".
Can someone help me ?
Context: Spring 3.12.
I think that, as coincidence that my dependency is from "classpath:", It can works in the following way:
@PropertySource({ "${config.file:config-file.properties}" })
Spring assumes that if an PropertySource or in general any spring resource is specified without protocol as "file:" or another one, then the resource is relative to the classpath.
So I can have an property as "-Dconfig.file=another-one.properties" or if I do not present this property my default value is "config-file.properties" relative to classpath as I wanted.
This resolves my problem for now.
I expect Spring 4 resolves the parser of ":" as written on many others posts.