maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Smith <bmjsm...@gmail.com>
Subject Re: Multiple packages with different configuration files
Date Tue, 23 Nov 2010 00:10:50 GMT
I believe you can specify multiple executions.

See:

http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Plugins

I think you could use the EAR plugin for example with three separate
executions, each with a configuration that excludes different files.

Hope this helps.

On 22 November 2010 23:19, <ilya.mayzel@ubs.com> 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?
>
>
> Thanks
>
> Ilya Mayzel
> Distributed Change Management
> UBS Financial Services Inc.
> 1000 Harbor Boulevard, 4th Floor
> Weehawken, NJ-07086
> Phone: 201-352-7976
> Email : ilya.mayzel@ubs.com
>
> -----Original Message-----
> From: Haszlakiewicz, Eric [mailto:EHASZLA@transunion.com]
> 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 setenv.sh 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.
>
> eric
>
> >-----Original Message-----
> >From: Ron Wheeler [mailto:rwheeler@artifact-software.com]
> >Sent: Monday, November 22, 2010 1:03 PM
> >To: users@maven.apache.org
> >Subject: Re: Multiple packages with different configuration files
> >
> >
> >JNDI will do the job on Tomcat.
> >
> >Ron
> >
> >
> >On 22/11/2010 1:47 PM, Antonio Petrelli wrote:
> >> 2010/11/22<ilya.mayzel@ubs.com>:
> >>> 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: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> Please visit our website at
> http://financialservicesinc.ubs.com/wealth/E-maildisclaimer.html
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message