In IntelliJ, I would like to have different configurations to start several Tomcat instances, but with different server.xml config files. Is there a way to do this?
views:
534answers:
4As far as I know there isn't. In the case I want to do that, I simply create 2 copies of Tomcat on my disk and create a configuration for both of them.
I found a way: create a directory, and put inside a copy of the conf dir from Tomcat, then use this new directory as the Tomcat base. This way, the tomcat binaries are shared, but the configurations are distinct.
If the configurations are different because of your application's needs, I'd say that editing server.xml is the wrong way to go about it.
A better solution is to have a context.xml for your app in META-INF. Keep the things that are specific to your app isolated from the server. You won't affect other apps that way, and you can't always count on being able to modify the server configuration if you're in a shared environment.