On 25 January 2011 19:23, Kalle Korhonen <kalle.o.korho...@gmail.com> wrote:
> On Tue, Jan 25, 2011 at 8:09 AM, Miguel Almeida
> <migueldealme...@gmail.com> wrote:
>>> I agree with you. I'm still quite new to advanced Maven topics so it still
>> seems counter-intuitive to store the config file outside the .war - it adds
>> one extra step of "deploy the .xml/config file" in the installation, but
>> like Mark pointed out it makes the WAR more independent and more agile to
>> configuration changes.
>
> If you had a finite number of configurations to support and you really
> wanted it all in a war, you could also organize your build as a base
> war module and then have the configurations in their own module and
> overlay them on top of the base war (google Maven war overlays).
> Profiles is the wrong tool for this job since there's no way you could
> release those properly. With an infinite number of configurations to
> support, the only right way is to externalize the configuration.
>

We have used profiles for environment specific configuration for
several years. And now we migrate all active projects into environment
agnostic solution, where all specific configuration is externalized.
Your binary must be built only once and deployed into repository (like
all Maven artifacts).

I realized that profiles could be only useful for automated
deployment. You can create additional Maven module e.g:
your-webapp-deploy and configure this module to deploy your web
application into environment specified by the profile. This additional
module uses m-war-p overlays mentioned in this thread already.

Please look at 
http://code.google.com/p/m4enterprise/source/browse/trunk/modular-war/modular-war-deploy/pom.xml.

Please notice that deployed binary is not a released binary from maven
repository. Deployed binary is a released binary overlay :-(

Marcin


> Kalle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to