[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: How to make Eclipse put jars into WEB-INF/lib?

David Karr wrote:
Eclipse 3.3.2.

It seems like I've battled with this before, but it escapes me now.

I have a dynamic web project that I've assembled from an existing WAR. I'm trying to figure out how to get the required jars for the project to actually deploy into WEB-INF/lib when the WAR is constructed. The project has no errors in Eclipse, but when I export the WAR, the WEB-INF/lib directory is empty.

In the Eclipse project, I have a "lib" subdirectory that contains all the jars, and I've put all of those jars into the build path.

I've tried to use the "J2EE Module Dependencies" page, because I thought this controlled what goes into WEB-INF/lib. In that dialog, I selected all the jars for this project and clicked OK. When I then go back into this dialog, all of those jars are unselected again.

For me, the selected jars stayed checked. As you have surmised, just including the jars in the build path doesn't by itself mark them for inclusion in WEB-INF/lib. Using the "J2EE Module Dependencies" page is the correct approach. However, it's not clear why they won't stay checked. You might check the Error Log view to see if something related is present. You could also try creating a new project, copy the lib directory, and see if you can duplicate this issue in the new project. If not, you can compare the ".classpath" and ".settings/org.eclipse.wst.common.component" files to see what the differences are. You could also try removing the jars from build path and adding them on the J2EE Module Dependencies page, which will automatically include them on the build path as well as include them in WEB-INF/lib.


Cheers,
Larry


When I export the project to a WAR file, it leaves the WEB-INF/lib directory empty.


I tried to deploy the project to Tomcat 6.0.14, but the context root is never available (gets 404). I see no deployment errors in the Tomcat console.