Here is an example profile in my POM:
<profiles>
<profile>
<id>QA</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<jdbc.url>jdbc:mysql://127.0.0.1:3306/SomeDB</jdbc.url>
<jdbc.username>webapp</jdbc.username>
<jdbc.password>somepassword</jdbc.password>
</properties>
</profile>
...
I then have a properties file in my resources folder like this:
jdbc.url = ${jdbc.url}
jdbc.username = ${jdbc.username}
jdbc.password = ${jdbc.password}
and finally I turn filtering on in my POM:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
...
This is actually a simplified example, but you get the idea. Basically when I run
mvn install -P QA
Maven will filter my app.properties file, replace all the placeholders with the values held in the profile, and deploy the populated properties file.
The problem with all of this is that I like to utilize the Servers mechanism in Eclipse, where I have Tomcat running within the IDE. My projects runs in this instance, and Eclipse takes care of updating, redeploying, etc. Maven is left out of the picture, however, during deployments within the IDE and this properties file never gets populated properly.
So, how can I continue running my project within the IDE, but have this properties file properly populated?