What is the recommended way of running an end to end integration test for multiple Spring
boot applications in the Maven
build\'s verify phase?
For certain reasons, I decided to use the second approach and had a similar problem to solve. I came up with a combination of maven-dependency-plugin and process-exec-maven-plugin.
So assume we have some applications (e.g. app_A
, app_B
, ...) and a module T
where the tests are implemented.
The idea was to copy applications to local build directory and start them, before starting tests. After test run the applications will be stopped.
To achieve this I added in module T
s pom the following build-configurations
...
org.apache.maven.plugins
maven-dependency-plugin
3.1.2
copy-app-A
copy
${project.groupId}
app_a
${project.version}
${project.build.directory}
app_a.jar
com.bazaarvoice.maven.plugins
process-exec-maven-plugin
0.9
start-external-server
start
run-app-A
java
-jar
${project.build.directory}/app_a.jar
stop-server
stop-all
...
For a working example I created a simple project.