views:

534

answers:

4

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?

+1  A: 

As 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.

Tom van Zummeren
+2  A: 

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.

Jazz
+1  A: 

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.

duffymo
It is the same webapp for several Tomcat instances, I only want to launch several instances for testing purposes.
Jazz
A: 

Take a look at How to use tomcat in IntelliJ community