IntelliJ: configure multiple Tomcat configurations with different server.xml

In IntelliJ, I would like to have different configurations to run multiple instances of Tomcat, but with different server.xml configuration files. Is there any way to do this?

+5
source share
3 answers

I found a way: create a directory and put inside a copy of conf from Tomcat, and then use this new directory as the Tomcat base. So tomcat binaries are common, but the configurations are different.

+9
source

As far as I know, no. In the case where I want to do this, I simply create 2 copies of Tomcat on my disk and create a configuration for both of them.

+1

If the configurations differ due to the needs of your application, I would say that editing server.xml is the wrong way to do this.

The best solution is to have context.xml for your application in META-INF. Keep things specific to your server isolated application. You will not affect other applications in this way, and you cannot always count on the possibility of changing the server configuration if you are in a shared environment.

+1
source

All Articles