7
votes

I'm using Eclipse Indigo 3.7 + WTP + m2e (including m2e-wtp). I've configured my Tomcat 7.0 server on Eclipse. I have a web application that I'm trying to run on Tomcat through Eclipse, but when I run it, the context.xml file is not copied to the conf/Catalina/localhost directory and this causes some issues to my app.

Where the context.xml should be put in order to be copied to this directory?

Thanks

1
@tostao Thx, I've already read this wiki but I don't see how it answers my question. - manash
I've edited the wiki page linked by @tostao to add the missing info - olivieradam666

1 Answers

10
votes

If you need to specify a context.xml file when deploying a WAR file to Tomcat, then it must be included within the WAR. The simplest way to achieve this is by adding it to your webapp resources:

src
|_ main
   |_ webapp
      |_ META-INF
         |_ context.xml

When You will build your web app (*.war) maven will join it to WAR in suitable place.