+ <build>
+ <resources>
+ <!-- ${basedir}/src/test/resources -->
+ <resource>
+ <!-- replace the place holders like ${...} in datasources.xml -->
+ <targetPath>${project.build.directory}/test-classes</targetPath>
+ <filtering>true</filtering>
+ <directory>${basedir}/src/test/resources</directory>
+ <includes>
+ <include>datasources.xml</include>
+ </includes>
+ </resource>
+ <resource>
+ <!-- all other test resources without filtering -->
+ <targetPath>${project.build.directory}/test-classes</targetPath>
+ <directory>${basedir}/src/test/resources</directory>
+ <excludes>
+ <exclude>datasources.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <!-- all main resources without filtering -->
+ <targetPath>${project.build.directory}/classes</targetPath>
+ <directory>${basedir}/src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <forkCount>3</forkCount>
+ <reuseForks>true</reuseForks>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>9.1.3.v20140225</version>
+ <configuration>
+ <stopKey>stop</stopKey>
+ <stopPort>9199</stopPort>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <jettyXml>${basedir}/src/test/resources/etc/jetty/jetty.xml,${basedir}/src/test/resources/etc/jetty/jetty-http.xml</jettyXml>
+ <!-- <jettyXml>./src/test/resources/etc/jetty/jetty.xml,./src/test/resources/etc/jetty/jetty-http.xml,./src/test/resources/etc/jetty/jetty-ssl.xml,./src/test/resources/etc/jetty/jetty-https.xml</jettyXml> -->
+ <systemProperties>
+ <systemProperty>
+ <name>cdm.datasource</name>
+ <value>h2_cdmTest</value>
+ </systemProperty>
+ <systemProperty>
+ <!-- datasources.xml is prepared by <plugins><resources>..</resources>
+ above -->
+ <name>cdm.beanDefinitionFile</name>
+ <value>${project.build.directory}/test-classes/datasources.xml</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>