Have you ever considered using Docker? Like you, I had a problem trying to do this, and my current solution is to use docker-compose to support the container for each application. I run each spring boot application in a simple container (example):
FROM openjdk:8-jdk-alpine VOLUME /tmp ADD target/module1.jar app.jar ENV JAVA_OPTS="" ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar
Then I use docker-compose to put it all together:
version: '3' services: module1: build: ./path/to/module1/Dockerfile ports: - "8080:8080" links: - module2 module2: build: ./path/to/module2/Dockerfile ports: - "8081:8081"
Please note that I have not tested any of these configurations since I am not on a dev machine right now and I have simplified the configuration to what is, in my opinion, minimal.
Jlove source share