Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse WTP does not publish project dependencies in WebContent

I am currently working on a Java EE project. I have successfully developed a web service and deployed it under the build-in Apache server of Eclipse, for test purpose.

I have now split my project into 2 projects : A master one and a dependency one (let's say "Utils"). When developing, eclipse doesn't complain about compilation problems, since I have added the "Utils" project as a dependency in my "build path" setup.

However, when launching Tomcat (as a embedded server), it complains about not finding the classes of "Utils" project.

I was expecting eclipse to copy the "Utils/bin" into WebContent/WEb-INF/classes, but it does not. How do I automate that ? So that "Utils/bin" gets deployed into the WebFolder whenever a change occurs ?

FYI, I do not use Maven yet (but I plan to).

Thanks in advance for your help, Kind regards,

Raphael

like image 559
Raphael Jolivet Avatar asked Jun 18 '10 14:06

Raphael Jolivet


2 Answers

Ross' answer put me on the right track, but in Eclipse Helios I couldn't find the Java EE Module in my dynamic web project.

Instead I found the way to add dependencies so they are built into the correct location was under the project's Properties -> Deployment Assembly, and from there I could add archives via path variable, from the file system, or from the workspace, as well as from a folder, a build path entry, or another project.

like image 143
chrisbunney Avatar answered Nov 11 '22 13:11

chrisbunney


You can do this by adding the Utils project as a module to your 'Master' project. I assume the master project is a web or ear application. Right click on the project -> properties -> Java EE module Dependencies. Add the Utils project to it. Eclipse will include the Utils project in the deployment.

like image 41
Ross Avatar answered Nov 11 '22 15:11

Ross