We use "profiles" in Maven2 to decide which configuration parameters to
build with. Take a look at the example project for Wicketopia for an
example of how we do that:
https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/
Basically, we add in a special resources directory that's based on a
parameter (called "configuration") defined in the pom:
<resources>
<resource>
<directory>src/main/conf/${configuration}</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
Then, we use Spring to load a properties file (using
PropertyPlaceholderConfigurer) that's inside that directory. So, all you
have to do to build a different version is:
mvn -Pprod install
and it'll run with the "production" profile.
On Wed, Dec 3, 2008 at 1:37 AM, Anton Veretennikov <
[EMAIL PROTECTED]> wrote:
> Hello Wicket users,
>
> I test my app on local Tomcat and update it frequently on remote. They
> have different MySQL DB connection params.
> What is the easiest way to decide which params to choose depending on
> where Tomcat is running without editing of xml-files?
>
> I need to know it during init() of Application because I must run
> upgrades of db tables / data when new version of app is uploaded.
> Tomcat thinks it is running on "localhost" on remote server
> (configured as Proxy Pass).
>
> Thank you
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>