I want to deploy multiple Spring Boot applications in one Tomcat server, each with different context paths, and I want to outsource the properties of each application. Specifically, I want the properties file names to follow the pattern {app-context-path}.properties.
I tried to dynamically set the spring.config.name property based on the context path in SpringBootServletInitialiser classes configure method but it was failed because the application context wasn’t initialized when **configure **method executed.
I’m wondering whether it is possible to outsource properties file based on the application context path or not?
Additional Information:
- Spring Boot Version: 3.3.1
- Tomcat Version: 10.1
- Build Tool: Maven
Thank you for your suggestions and help!
Otabek Toshkanov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1