how to configure java web application in eclipse to reflect changes in backend jar after deploy on tomcat

家住魔仙堡 提交于 2019-12-12 03:42:16

问题


I have java web project in eclipse. This project depends on other non-web project (let say backend project). When I make a change in backend project, and then deploy web project to tomcat and start tomcat, changes don't appears.
It works only following way: I have to build backend.jar, copy it to web project web-inf/lib directory, and then deploy it on tomcat and run it.

java se6, tomcat 6, eclipse 3.7

Do you know how to handle this problem?

Thanks


回答1:


I'm not sure I understand the problem, but... If you want to have the changes in "backend project" seen by your web project, the web project has to contain the updated backend project jar.

I have several projects like this, and typically I build the backend project which creates backend.jar. If Tomcat is running, I will stop it. Then, I will build the web project (it has a dependency on the backend.jar). The web project will produce it's output folders, including placing the new backend.jar in the WEB-INF/lib directory. When Tomcat is started, the new backend.jar changes are visible.

Is your web application build not picking up a new backend.jar?




回答2:


Activate Project->Build Automatically. You only have to publish to tomcat every time you make changes to your depended projects.




回答3:


So right click on your web project -> properties -> Deployment Assembly.

There is possibility to "add". And you can choose folder, jar or project. After it, remove and add back you web project to web server. Than you should see small arrow next to your project. When you click on it, all referenced projects appears. And that is it.

Maybe is also important on backend projects setup facet "Utility Module".



来源:https://stackoverflow.com/questions/11332871/how-to-configure-java-web-application-in-eclipse-to-reflect-changes-in-backend-j

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