开发者

eclipse web project dependency

i have one eclipse project(A) with a small spring application and another one with a web application using GWT (B).

project A exports its ressources via build path / order and export. project B imports the ressources via build path / projects.

eclipse adds the files to the build path and to the system class path of the run-targets but this results in strange spring-errors because the files are not being loaded with the web-classloader.

for correct behaviour on the webserver-targets the exported ressources (.class, META-INF/spring/*) of project A have to be copied in project B/war/WEB-INF/classes.

how ca开发者_如何学Cn i accomplish this task using eclipse?

thanks a lot for your help!


your last assertion is wrong, your exported resources can (and should) be copied to B/war/WEB-INF/lib as a jar file. You can achieve this by adding projectA as a J2EE Module Dependency of projectB. This insructs Eclipse+WTP (you are using WTP, right?) to deploy projectA as a jar to the web container that you are using (tomcat?).

This is an unfortunate duplication of classpath information in eclipse projects. The fact that you exported the build path resources of projectA is sufficient for regular java projects, and also for static compilation, but not for runtime of WTP web projects.

eclipse web project dependency

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜