maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: Multiple packages with different configuration files
Date Mon, 22 Nov 2010 23:19:05 GMT

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? 


Ilya Mayzel
Distributed Change Management
UBS Financial Services Inc.
1000 Harbor Boulevard, 4th Floor
Weehawken, NJ-07086
Phone: 201-352-7976
Email :
-----Original Message-----
From: Haszlakiewicz, Eric [] 
Sent: Monday, November 22, 2010 3:38 PM
To: Maven Users List
Subject: RE: Multiple packages with different configuration files

Well those are some rather useless answers.
JNDI will only "do the job" if you configure it that way.  You need to
get that configuration *into* tomcat somehow in the first place,
regardless of whether you use JNDI or a properties file.

To suggest some options for the original poster:
  There are several different options to choose which configuration gets
used or included in a application package.  One way, which I have used a
fair amount, is to include all configurations, and have an environment
variable that you set when you run that app that causes it to choose the
right file.  The exact method of doing this depends on exactly how your
configuration is stored, but it might consist of things like having
property references in spring config files, tomcat scripts
that pass appropriate java options, or custom java code within your app
that looks for the variable settings.

On the other hand, if you want actual, separate application packages,
each that only contains a single set of configuration options, well then
you're back in the realm of how to get maven to do that for you.  What
I've done for this is use profiles with embedded ant tasks that copy the
appropriate files into place.  Then to build a dev environment you might
do something like "mvn -P dev package".  Of course, you can use any
other plugin config within a profile other than the ant plugin, such as
having separate assembler plugin configs and include different
configuration files that way.
There's lots of way to do it; I'm not sure what the best one is.


>-----Original Message-----
>From: Ron Wheeler []
>Sent: Monday, November 22, 2010 1:03 PM
>Subject: Re: Multiple packages with different configuration files
>JNDI will do the job on Tomcat.
>On 22/11/2010 1:47 PM, Antonio Petrelli wrote:
>> 2010/11/22<>:
>>> This app need to be packaged with different configuration files 
>>> (server names/IP addresses) for Dev/QA/Prod environments.
>> This kind of info are better put in the server. For example, for 
>> JBoss, you can create a .properties file and put it inside:
>> <jboss>/server/<yourserver/conf
>> Everything in the conf directory is available in your classpath.
>> Antonio
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Please visit our website at 
for important disclosures and information about our e-mail 
policies. For your protection, please do not transmit orders 
or instructions by e-mail or include account numbers, Social 
Security numbers, credit card numbers, passwords, or other 
personal information.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message