Eclipse – way to make WTP + M2Eclipse work together with a “war:inplace like” configuration

eclipse-wtpm2eclipse

I try to work with M2Eclipse, WTP and a Tomcat 5.5 server configuration.
Publication of classes + web resources in wtp.deploy directory seams very time consuming if your webapp contains many files. Furthermore publishing operation can be prone to error as I have many maven modules as dependencies. I try to find a biaised-but-faster way to use WTP.

With Java sources in

  • src/main/java
  • src/main/resources

with default maven output directory

  • target/classes

And web resources in

  • src/main/webapp

I want to make WTP work with a Tomcat server this way :

  1. M2Eclipse is responsible of the
    build (nothing to do)
  2. No publication phase :
    • WTP points to maven classes build output (don't know how to do this ?)
    • WTP points directly to the web resources (possible tweaking the docbase)
  3. WTP take into account any change I do either on classes or web resources (not sure it's possible for classes without restarting tomcat ?)

Is it possible or should I move to maven jetty plugin ?
Any help is apreciated 🙂

Best Answer

What you want is probably the "Serve modules without publishing" setting to let allow tomcat straight access to the eclipse-generated resources.

In the servers view, double click the server name, e.g. "Tomcat v6.0 ...", the setting is under the "Server Options" heading.

Starting tomcat in debug mode enables hot code replace.

Source: http://www.eclipse.org/forums/index.php?&t=msg&goto=523599

Related Topic