+1 for using external 'properties'

Usually you like to produce only one WAR file and use exactly this single WAR 
file on your test box, move it further to the integration test server and then 
move it to the production server. The SHA-1 of the WAR _must_not_ change! If 
you need to rebuild a different WAR for your production server, then all the 
previously testing steps are pretty much worthless...

In my projects (using OpenWebBeans as CDI container) I use 
@ProjectStageActivated [1] for switching between configurations.

LieGrue,
strub

[1] https://cwiki.apache.org/confluence/display/EXTCDI/Core+Usage

--- On Tue, 1/25/11, Anders Hammar <[email protected]> wrote:

> From: Anders Hammar <[email protected]>
> Subject: Re: One project per package or multiple packages in same project?
> To: "Maven Users List" <[email protected]>
> Date: Tuesday, January 25, 2011, 11:35 AM
> 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
> > ?
> >
> 




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

Reply via email to