Assume I get a properties file from somewhere, that has this define:
dog=POODLE
And when running maven, I pass a parameter with the property name to look up:
mvn clean install -animal=dog
I need to be able to retrieve in the pom.xml the value "POODLE"
without knowing what's the property to look up for (I don't know yet that I'm looking up for a "dog", but only that I'm looking up for an "animal").
Can this be done?
I can reference in the pom ${animal}
which will be replaced with dog
, but then I need to look that up.
I was innocent enough to try the following, but it won't work:
${${animal}}
Thanks!
It should work if you use
-Danimal=${dog}
. Here is my examplerun with:
mvn -Danimal=${dog} install
results in