On Tue, Nov 23, 2010 at 9:49 AM,  <[email protected]> wrote:
> Eric,
>
> Let me elaborate on the issue. I cannot use profiles as it will create
> only one distribution for me. I need to have the same compiled cod
> bundled with different config files for DEV/QA/PROD. Is there are any
> easy way to create 3 TAR files from one jar or war and include different
> sets of config files within each of them? How can I implement it with
> Assembly mojo?

Apply Dont Repeat Yourself princiiples plus separation of concerns.

As someone already suggested the best way is to make your operations
team take your one EAR and apply the specific environment
configuration as part of the deployment process, how you do this is
specific to you application server.
The general practice appears to be having a directory included on the
application server's classpath and you put your applications specific
config files here.
The operations team need to keep their copies of the configuration
files up to date with any dev changes (like new configuration
variables).
Ideally you want to make this file as small as possible (i.e
production passwords and ip, port, url values)
Any values that are configurable, but dont generally change across
environments, like timeout values should be in another file.  These
values are configurable so you can tweak them without recompiling but
they would normally be the same across all environments. This
configuration file may be bundled in your applications jar, or
deployed into your application server config directory depending on
how easily you want people to be able to tweak these values.

Another approach (which I dont recommend) is to create a maven module
for each environment.
Then you can use the assembly plugin to bundle your EAR plus your per
environment configuration file into your tar.
The problem with this is you have just created X copies of your tar
(and normally it will use a large amount of disk space) where the only
difference is the configuration files.
You've saved your ops team a little effort by creating a single bundle
but you've just made your build/release process a lot slower.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to