Docker [SOLVED]: Maven integration tests with 2 modules

Docker [SOLVED]: Maven integration tests with 2 modules

Home Forums Automation Tools Docker Tutorials Docker [SOLVED]: Maven integration tests with 2 modules

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #245034

    Cloudy Point


    I have an application with 2 modules:

    • Web JSF (WAR deployed on Tomcat)

    • REST Services (WAR deployed on Wildfly)

    For integration tests I use maven plugins:

    • maven failsafe plugin

    • fabric8 maven plugin

    My tests source code and resources are located in both applications src/integration-test/java.

    In integration tests phase fabric8 builds Wildfly docker image, copies built articact (REST Services WAR), starts container and runs tests. It works correctly.

    But… I would like to configure maven to deploy 2 applications (
    Web JSF WAR artifact and REST Services WAR) and run integration tests from JSF WAR/src/integration-test/java.
    Using fabric8 plugin its easy to build and run Tomcat and Wildfly containers but I cant find how to deploy 2 different artifacts from different maven modules.
    Maybe do you have any idea?

    Best regards,


    Cloudy Point

    Accepted AnswerAnswer

    io.fabric8 docker-maven-plugin supports multiple images. You can create a module responsible for running the integration tests. This module will depend on 2 WAR artifacts you’ve mentioned in the question.


    Then you can setup necessary containers using io.fabric8. Here is an example from my project (some details are removing for sake of simplicity and conciseness of the answer). The example is not about Tomcat and Wildfly but just to illustrate the idea.

                                <run>mkdir -p /run/jetty /tmp/jetty</run>
                                <run>chmod -R 1777 /tmp</run>
                                <run>chown -R jetty:jetty /var/lib/jetty /run/jetty /tmp/jetty</run>
                                <inline xsi:schemaLocation="">

    Author: Alex Binkovsky
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.