How do Spring Boot multiple module merge into one war package?

I now have a requirement that applications containing multiple Spring Boot module are merged and packaged into a single war, each module is a separate business and has its own context path.

the production environment of customers is their own Paas platform, which is packaged through Jenkins and then automatically uploaded to the corresponding server cluster. I can only choose packages that have already been packaged for deployment. I cannot operate to a specific tomcat, and require multiple applications to be deployed in one tomcat. I have tried overlays of maven-war-plugin , but this configuration does not allow duplicate files, so I give up.

Project structure is a maven project, which contains multiple sub-Spring Boot module

moduleA
 |
 - src
 - pom.xml

moduleB
 |
 - src
 - pom.xml
pom.xml

does anyone have a similar problem? Or is there any good solution?

Aug.19,2021

if it contains multiple packages, it looks like EAR, but TOMCAT doesn't support EAR very much. Why do you want to pack together? With zuul and spring cloud, deployed separately, is it not good to control access through routing?
do you want to change one line of code and redeploy all the Module?

Menu