I have a properties file whose contents are filtered based on properties defined in a series of Maven profiles. The properties define database connection information (driver, username, etc). It is used to run JUnit tests. IntelliJ+Maven is working great so long as I run the tests with the default profile. However as soon as I try to use one of the other profiles I have problems. The issue is that it does not use the properly filtered property file.
In fact, I switched the profile in the Maven tool window and ran the "process-test-resources" phase (again via the Maven tool window). I verified that the properties file was filtered correctly and moved to the target directory. However as soon as I try to run the test something regenerates that resource filtering back in the default profile values. Quite frustrating.
What do I need to do in order to run tests in IntelliJ under a different Maven profile? Is that even possible in IntelliJ?
BTW, here is the resource file: http://fisheye.jboss.org/browse/Hibernate/core/trunk/testsuite/src/test/resources/hibernate.properties?r=16397
and here is the pom containing the profiles: http://fisheye.jboss.org/browse/Hibernate/core/trunk/parent/pom.xml?r=19358#l557
It is the h2 profile with which I am trying to run.
And yes it works fine from both command line and hudson which are the other 2 environments I utilize.