Search code examples
javaeclipsetomcateclipse-wtp

Deploy multiple webapps with application specific config in Tomcat from Eclipse


I have a Tomcat 7 Server in Eclipse with two webapps a and b and need to find out how to have application specific configuration files for tomcat that works with Eclipse.

Now I want for each webapp a custom config file, like described here: Apache Tomcat: multiple webapps. So I created a <TomcatDirectory>/conf/Catalina/localhost folder and put the a.xml and b.xml there. This works fine when I run Tomcat from command line.

But where have I to put the application specific configuration files a.xml and b.xml when I run Tomcat from within eclipse?

I already tried to put the files in Eclipse in <EclipseWorkspace>\Servers\<ServerName>\conf\Catalina\localhost\ but WTP does not copy this files to <EclipseWorkspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost


Solution

  • Leave them in <TomcatDirectory>/conf/Catalina/localhost

    Server > Open > Server Locations

    Change from: Use workspace metadata To: Use Tomcat instalation

    Now a.xml and b.xml from <TomcatDirectory>/conf/Catalina/localhost will be used.