I've created a bunch of projects in Eclipse 3.7.2. Let's give some of them a name:
- W (a Dynamic Web Project)
- A (some library)
- B (a library with lots of common stuff, that is used by other projects too)
Project A depends on project B, so B is in A's build path. Project W depends on project A so I've added A as Deployment Assembly in W.
When I export a WAR from within Eclipse only the JAR file for A gets added to WEB-INF/lib. Eclipse shows the following warning:
Classpath entry /B will not be exported or published. Runtime ClassNotFoundExceptions may result.
The warning is correct. I get a ClassNotFoundExceptions at runtime. Of course Eclipse provides a Quick fix for the warning which is "Mark the associated raw classpath entry as publish/export dependency". However, this doesn't fix my problem. B still doesn't get deployed with W.
I tried manually adding B as Deployment Assembly in A . That includes the B.jar within A.jar which isn't really what I want and I still get the ClassNotFoundExceptions.
The only thing that works is manually adding B as Deployment Assembly in W. Eclipse still shows the warning from above, but the runtime exceptions are gone.
Am I missing something or is this really the only way to get this working?