I'm struggling to synthesise how to correctly use the maven-failsafe and fabric8-maven plugins together.
I Want to run integration tests, but in the pre-integration-tests phase, start a docker container running a DB, and in the post-integration-phase stop the container.
Looking at the fabric8 docker-maven-plugin documentation, it states this is possible, but none of the examples seem to illustrate this.
Update #1:
This is the configuration that successfully worked for me:
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.15.9</version>
<executions>
<execution>
<id>start-neo4j</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-neo4j</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<images>
<image>
<alias>neo4j</alias>
<name>neo4j:2.3.2-enterprise</name>
<run>
<ports>
<port>7474</port>
</ports>
<wait>
<log>Starting...</log>
<time>20000</time>
</wait>
</run>
</image>
</images>
</configuration>
</plugin>