-----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: dev@cocoon.apache.org
To: dev@cocoon.apache.org
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.

- -- Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEcrarLNdJvZjjVZARAl6/AJ9ZKybOA2No2vcUcQrihi2NnkB2SQCg4Er3
3q27VzVgBz9wntlS+b03vKQ=
=31fW
-----END PGP SIGNATURE-----

Reply via email to