I have two projects, call them ‘A’ and ‘B’, in my workspace. Project ‘A’ is a regular Java project that contains some utility classes and common classes used by project ‘B’ (and other projects that are unrelated to the problem).
In Eclipse, it’s easy to get this working by including a reference in the build path for project ‘B’ so that it includes project ‘A’. No problems here.
However, project ‘B’ happens to be a web application built using MyEclipse – when I deploy to the app server, the generated WAR does not contain the classes and/or JAR from project ‘A’, leading to NoClassDefFound errors when running the application.
Is there a way to tell MyEclipseIDE’s packager that it should bundle the external resources from other projects?
PS – I’ve already tried to export project ‘A’ to a JAR and include this JAR as an external JAR in project ‘B’s build path – Deployment still fails to include the JAR file I’ve specified, leading to the same problems.
PPS – Is there a simple way to just generate a WAR file from a web project and just place it in the FS somewhere? When I try to export JARs or ZIPs, it includes all of the workspace structure (eg folders named ‘WebRoot’ etc) and thus results in an unusable WAR. It seems as if the deployer is doing this, but is there a way to generate it separately via File->Export or something similar?