Set up an Eclipse Dynamic Web Project referencing another project

懵懂的女人 提交于 2019-12-29 07:04:49

问题


I've got a simple Dynamic Web project set up in Eclipse 3.6 Helios, but am having trouble getting it to make use of the code in another project that I've got.

I've added a reference to my other project to the build path of my web project, and I've got no problems in terms of compiling, only in terms of deploying and testing the result. The built web application doesn't have a jar in the WEB-INF/lib directory, so fair enough it can't find the code. The question is how I set this up. I've looked through the help that I can find and googled a bit but can't find anything obvious that helps out.

How do I set up my web project so that on deploying it it magically has the code from my dependent project inside it?

Thanks.

Note: Ideally I'd like a solution that doesn't involve setting up some kind of build tool. The web project deploys itself without recourse to any build tool (or at least none visible to end user), so was rather hoping that a references project could be integrated into that easily.


回答1:


What goes in the deployment is determined not by the build path but by the Deployment Assembly entry in Preferences for the dynamic web project.




回答2:


Use some build tool like ANT or Ivy or Maven that, on build, copies all the dependencies to WEB-INF/lib

Using a build tool is a good practice to automate build, test and deployment. You may also be interested in plug-ins like Maven Reactor.



来源:https://stackoverflow.com/questions/4646684/set-up-an-eclipse-dynamic-web-project-referencing-another-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!