Antonio is right.

This has been discussed several times. Search the archive for many examples
of doing this, including using JNDI or putting a properties file on the
classpath.

I understand this would require changes to your code base. Major changes
possibly. But it is the right way to go. Once you have donw this, adding new
environments is a small task instead of requiring a new build (and breaking
close to everything Maven is about).

/Anders

On Tue, Jan 25, 2011 at 12:26, Miguel Almeida <[email protected]>wrote:

> On Tue, Jan 25, 2011 at 11:18 AM, Antonio Petrelli <
> [email protected]> wrote:
>
> >
> > No, he means (correct me if I am wrong) that you should have a war for
> > each web application you have. Since you have *one* web application,
> > one war is ok.
> > Configuration like IP addresses, ports, etc. should be externalized
> > and not put in the WAR at all.
> >
>
> Externalised where exaclty? Because that's precisely my configuration: I
> have one WAR and configuration is being externalised to profiles, like so:
>
> <profile>
>            <id>dev</id>
>            <properties>
>                <isDevelopmentMode>true</isDevelopmentMode>
>
>
>  
> <hibernate.connection.url>jdbc:postgresql://locahost/develomentDB</hibernate.connection.url>
>                <application.uploadPath>/mnt/devel/</application.uploadPath>
> ...
>            </properties>
> </profile>
>
> My original questions were, therefore:
> a) is this the best way to keep my project?
> b) when I package the WAR, what profile should I use? Or should I archive
> project-0.0.1-dev, project-0.0.1-clientTest, project-0.0.1-clientProduction
> ?
>

Reply via email to