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.
Regards
Jorg