Or use Spring and tell it (via -D or another property) which file to
use. I think this is a common approach to this problem.
Wayne
On 4/12/08, David C. Hicks <[EMAIL PROTECTED]> wrote:
> Two possibilities come to mind:
> 1) Set up 2 separate war artifacts, each with its own properties file.
>
> 2) Externalize your properties so that the same war file can be used with
> different settings.
> It might make sense to use JNDI to look up your data source, instead of
> using properties, and let your app container manage the pool of connections
> for you.
>
>
>
> Javier Sandino wrote:
> > Hi there:
> > I have a maven web project which produces a war
> > artifact, say foo-1.0-SNAPSHOT.war
> > This war file contains a java properties file,
> > foo.properties, specifying the default,
> > deployment-specific configuration variables to be used
> > in production:
> > db.host=production.foo.com db.name=production_db
> db.url=jdbc:mysql://${db.host}/${db.name} db.user=admin
> db.password=admin : other props...
> > In maven this file resides in the usual place, under
> > /src/main/resources. I also have another file, under
> > /src/test/resources/foo.properties with entirely
> > different deployment values:
> > db.host=test.foo.com db.name=test_db
> db.url=jdbc:mysql://${db.host}/${db.name} db.user=dev
> db.password=dev : other props...
> > I would really like to use this test properties file
> > for my integration tests, without having to package it
> > in the final war.
> > Is there a way to tell the maven-war-plugin to
> > generate two wars, say foo-1.0-SNAPSHOT.war and
> > foo-1.0-SNAPSHOT-test.war, where the former contains
> > my production deployment properties while the later
> > packages the test deployment properties?
> >
> > Any examples would be greatly appreciated.
> >
> > If this is not possible with maven-war-plugin, is
> > there an alternative mechanism to achieve the same
> > result?
> > Thanks.
> >
> >
> >
> __________________________________________________________________
> > Be smarter than spam. See how smart SpamGuard is at giving junk email the
> boot with the All-new Yahoo! Mail. Click on Options in Mail and switch to
> New Mail today or register for free at http://mail.yahoo.ca
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]