Eclipse Web Project Dependencies

This question is about Eclipse development, I am trying to create a web application in Eclipse, the problem is that I don't get the the dependencies jars to the deployed archive.

I've created a new dynamic web project and linked it to another Java project. The Java project references a few 3rd party jars (e.g. Spring jars) but for some reasons when publishing the web project I get only the Java project jar in the lib dir of the war, without the Java project dependencies (e.g.Spring).

In other words, I have project A (web project) that depends on project B (Java Project), project B depends on Spring jars. When I publish the web project as a war to JBoss only project B is packaged into the jar (no spring jars)

I know I can do it with ant, I even have such build.xml to build the whole app, but I thought eclipse can also perform the packaging task for me.

I added the Java project to the Java EE module dependencies in the web project.

Should I use the export option in the Java project build path properties? should I add the dependencies of the Java project to the web project as well?

What am I doing wrong?

Edit: I am using Eclipse 3.5.1


  1. Go to web project properties.
  2. Deployment Assembly (Left).
  3. Add > Select project > Select your lib project > Check "Assemble projects into the WEB-INF/lib folder of the web application" if not checked > Finish.
  4. Java Build Path (Left) > Projects Tab > Add... > Select your lib project > OK
  5. Java Build Path (Left) > Order and Export Tab > Select your lib project.
  6. Save
  7. Now it works.

I know it's been four years since the last post, and maybe this option wasn't available back then, but here's what worked for me:

  1. Go to Web Project->Properties
  2. Deployment Assembly
  3. Use the 'Add' button to add your project dependency
  4. Go to Project->Properties for the project you're depending on
  5. Deployment Assembly
  6. Use the 'Add' button to add the project's runtime library dependencies
  7. Web Project->Run As..->Run On Server and it worked for me

Be warned that steps 4-6 will mean that if you're using eclipse to build your jar file, it will now include your dependent libraries in that jar.

Thanks to rodgarcialima for helping me get to step 3.