简体   繁体   中英

IntelliJ: configure several Tomcat configurations with different server.xml

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?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM