Using maven-failsafe with fabric8-maven to run integration tests that hit a containerised DB
<p>I'm struggling to synthesise how to correctly use the maven-failsafe and fabric8-maven plugins together.</p>

<p>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.</p>

<p>Looking at the fabric8 docker-maven-plugin <a href="https://github.com/fabric8io/docker-maven-plugin/blob/master/doc/intro.md" rel="nofollow">documentation</a>, it states this is possible, but none of the examples seem to illustrate this.</p>

<p>Update #1:</p>

<p>This is the configuration that successfully worked for me:</p>

<pre><code>&lt;plugin&gt;
    &lt;groupId&gt;io.fabric8&lt;/groupId&gt;
    &lt;artifactId&gt;docker-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;0.15.9&lt;/version&gt;
    &lt;executions&gt;
        &lt;execution&gt;
            &lt;id&gt;start-neo4j&lt;/id&gt;
            &lt;phase&gt;pre-integration-test&lt;/phase&gt;
            &lt;goals&gt;
                &lt;goal&gt;start&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
        &lt;execution&gt;
            &lt;id&gt;stop-neo4j&lt;/id&gt;
            &lt;phase&gt;post-integration-test&lt;/phase&gt;
            &lt;goals&gt;
                &lt;goal&gt;stop&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
    &lt;configuration&gt;
        &lt;images&gt;
            &lt;image&gt;
                &lt;alias&gt;neo4j&lt;/alias&gt;
                &lt;name&gt;neo4j:2.3.2-enterprise&lt;/name&gt;
                &lt;run&gt;
                    &lt;ports&gt;
                        &lt;port&gt;7474&lt;/port&gt;
                    &lt;/ports&gt;
                    &lt;wait&gt;
                        &lt;log&gt;Starting...&lt;/log&gt;
                        &lt;time&gt;20000&lt;/time&gt;
                    &lt;/wait&gt;
                &lt;/run&gt;
            &lt;/image&gt;
        &lt;/images&gt;
    &lt;/configuration&gt;
&lt;/plugin&gt;
</code></pre>