Thanks Greg,
I tried your solution but I am still having problems, the
properties file just got copied over without any filtering.
I then changed my pom to:
:
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>src/main/filters/env-dho/filter.properties</filter>
</filters>
:
But the filtering still doesn't happen when I simply execute
"mvn -e process-resources". The db-config.properties file just gets
copied over without any filtering.
My db-config.properties looks like:
db.drivername=${db.drivername}
db.urlscheme=${db.urlscheme}
db.hostname=${db.hostname}
db.name=${db.name}
db.username=${db.username}
db.password=${db.password}
db.port=${db.port}
And my filter.properties looks like:
db.drivername=com.inet.tds.TdsDriver
db.urlscheme=jdbc:inetdae7:
db.hostname=TESTDB01
db.name=DBNAME
db.username=user
db.password=passwd
db.port=1433
Did I specify the filter names wrong?
Thanks,
Dennis.
-----Original Message-----
From: Greg Case [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 22, 2005 11:28 AM
To: Maven Users List
Subject: Re: [M2]How to use filtering with build profiles?
Dennis,
I think what you want to do is move the <filters> definition into each
profile itself, rather than referencing a property in the "non-profiled"
build. At least that's how I am doing it, and it works fine. Not sure if
it
is best-practice or not... So your pom would like like this:
<project>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>env-dho</id>
<activation>
<property>
<name>env</name>
<value>dho</value>
</property>
</activation>
<build>
<filters>
<filter>src/main/filters/env-dho/filter.properties</filter>
</filters>
</build>
</profile>
<profile>
<id>env-dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<filters>
<filter>src/main/filters/env-dev/filter.properties</filter>
</filters>
</build>
</profile>
</profile
Hope that helps,
Greg Case
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]