Giacomo Pati wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, 22 May 2006, Jorg Heymans wrote:
Date: Mon, 22 May 2006 20:32:39 +0200
From: Jorg Heymans <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [2.2] Configuration
Reinhard Poetz wrote:
Suppose you have two environments: development (dev) and production
(prod). If you create the web application, you might need different
.xconf (database connections, root sitemap, ...) values and different
properties.
...
I propose that we have a directory "src/main/webapp-profiles" that
contains all files for different profiles:
src/main/webapp-profiles/dev/WEB-INF/xconf/cocoon-sitemap.xconf
src/main/webapp-profiles/prod/WEB-INF/conf/cocoon-sitemap.xconf
src/main/wenbapp-profiles/dev/WEB-INF/properties/core.properties
src/main/wenbapp-profiles/prod/WEB-INF/properties/core.properties
Just fyi, you can define placeholders a la ${my.db.url} in text files
and have these replaced by maven during build time.
So you could do
<build>
<filters>
<filter>src/main/filters/${env}.properties</filter>
</filters>
<resources>
<resource>
....
<filtering>true</filtering>
<includes>**/*.xconf</includes>
<resource>
<resources>
</build>
combined with this in settings.xml:
<profile>
<activation>
....
<properties>
<env>prod</env>
</properties>
</profile>
Note that ${env} in the pom is resolved to the <env> property in the
profile.
That way you wouldn't have to duplicate your configuration files.
+1 to this as that is IMHO the standard way maven2 works.
yes, that should be good enough - I was thinking too complicated ;-)
I will add this to cocoon-22-webapp-archetyp.
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de