I have it. I took half the night, but it works :)
At first I also thought about symbolic links, but under Windows this is not what you would like to use. My second thought was to change catalina.bat , but it's not so simple. And different CATALINA_HOME not what I really want.
So what have I done? I provided server.xml as a parameter to catalina.bat .
catalina.bat start -config \conf\server_test.xml
Nice and easy :)
You can have many server configuration files and specify the one you need to start and stop the script. The difficulty is that the Catalina class gives incorrect usage information:
usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { start | stop }
But if you exchange parameters and first provide " start " or " stop " and then the " -config ... argument, everything works.
It is also very nice that you can use this solution to create a different launch configuration in IntelliJ IDEA. I have one where Tomcat connects to the local database and connects to the development database. For each, I have a different server.xml .
Hope this helps.
Regards, Sebastian
seb
source share