I have J2EE project based on maven. This project contains connection to database, which is set up via resources.xml and persistence.xml. Connection works fine for normal deployment.
My problem is, that i would like to run embedded TomEE server for integration tests. For these tests i need use inmemory database.
To start TomEE i use combination of maven plugins showed below.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.13</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomee.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>7.0.4</version>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<checkStarted>true</checkStarted>
</configuration>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<simpleLog>true</simpleLog>
</configuration>
</plugin>
When i start maven goal mvn install, server runs as expected, but with wrong DB connection. I did not find way, how to set up, that i need use src/test/resources instead of src/main/resources.
Do you know how to set up this plugin in way? I'am open to suggestions of similar solutions, which is simple and do not contains 'lot of' frameworks.
Thank you in advance.