开发者

Is there a way to make WTP + M2Eclipse work together with a "war:inplace like" configuration?

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 i开发者_如何学JAVAs 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 :)


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


I don't think it is possible to make WTP work that way. The way WTP work with Tomcat is it creates a staging directory/project in workspace that it synchronizes with your project (I believe it is incremental). So, the WTP does all the copying files around and tracking modified resources and classes.

If you want to avoid this, there isn't much sense to use WTP and you can just stick to Jetty runner.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜