Yes, this is the only thing I've ever done. Unfortunately all the JEE specs 
don't seem to be well thought out in this regard.

For a given runtime the model I use is one where there is a launcher, a binary 
part (libs and app), and configuration. I combine these three things to make a 
working runtime. I may launch in an IDE vs a production system (using JSW, 
daemon tools, shell scripts), and configurations are going to be different for 
all environments especially dev vs production, but the binary part remains 
constant.

The launcher for your production environments should be fairly regular as well, 
so it is really only your configuration that changes. To deal with 
configuration I generally package templates in JARs, and while being extracted 
I filter them against a known set of variables.

This is how I construct Facebook's Presto server: 
https://github.com/facebook/presto/blob/master/presto-server/src/main/provisio/presto.xml

Under the launcher section there is the configuration as well. We're adjusting 
how the server is constructed but you get the idea.

On Sep 10, 2014, at 10:03 AM, Jan <[email protected]> wrote:

> Hi All,
> 
> Does anyone using Maven as Build Once and deploy Everywhere method? Like
> lets say i don't want to recompile my source code everytime for different
> environment DEV,SIT,UAT & PROD. I want to do my compile and package only at
> DEV then deploy the artifact to all mentioned environment. Is this possible
> using Maven, is there any reference any one could share with me Please.

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

believe nothing, no matter where you read it,
or who has said it,
not even if i have said it,
unless it agrees with your own reason
and your own common sense.

 -- Buddha









Reply via email to