Hi all,
As I understand it, maven loads its properties from project.properties, build.properties, $HOME/build.properties and the "-D" defines on the command line, in that order, where the last definition wins. However I find myself frequently in the situation where I want another level of property overriding for building particular "configurations" of my project.
Here's an example: when building for our production servers, we need to "touch" the built files to match the timestamp of the production server (GMT), however in our development environment we don't wish to do this. The touch offset (eg: "-10") is defined in our build by a property ("touch.offset").
Now when building for our production machines, I could say: maven -Dtouch.offset=-10 release
but if I have a lot of properties that need to be over-ridden, this becomes unwieldly, and its easy to forget them. Instead, I'd love to be able to do something like:
maven -Dprops=production.properties release
where "production.properties" contains: touch.offset = -10
and overrides all other properties (ie: it behaves as if you'd specified those properties on the command line).
Does anyone know if there's a way to do this? Failing that, is there a way that I can achieve the same end by programatically loading the properties file in maven.xml? Any suggestions appreciated.
Probably not the best solution, but one possible (for a UNIX-like environment, bash in this case):
maven -D$(cat production.properties | xargs | sed -e's/ / -D/g') release
Regards, Gisbert Amm
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]