Paul Gibler
Paul Gibler

Reputation: 276

How do I make Eclipse automatically include jars I place in my WEB-INF/lib folder into my project?

When I was doing JSP/Servlet programming, whenever I dropped 3rd party libraries into the WEB-INF/lib folder, they were automatically included in the project classpath. In GWT, this is not the case. Anyone know why? I loved how easy this was in JSP and I'd like these jars to be included automatically the same way.

Upvotes: 3

Views: 5133

Answers (4)

Pascal Thivent
Pascal Thivent

Reputation: 570295

If you are using the Google Plugin for Eclipse then my understanding is that a Google Web Application Project is just not the same animal than a Dynamic Web Project and thus behave differently. So if your project depends on libraries not provided by the GWT and App Engine SDKs, you'll need to put them in war/WEB-INF/lib and to add them explicitly to your Java build path.

Upvotes: 4

insipid
insipid

Reputation: 3308

There is a plug-in technique that may help you if you want a directory where new jars are automatically updated in your build path, see this other post:

Eclipse buildpath automatically taking all JARs of a internal directory

The reason it works like this for your JSP's is because that is how the Dynamic Web Project was made to behave.

"If you remove a library path entry but not the JAR file, the library entry will be re-added to the path automatically." from http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html

Upvotes: 1

ChadNC
ChadNC

Reputation: 2503

In Eclipse Galileo, right click the web project and select build path then select the Java EE Module Dependencies and add the jars.

Upvotes: 1

Drew Wills
Drew Wills

Reputation: 8446

You could adopt Maven and use the Maven Eclipse Plugin; this plugin would update your classpath whenever you add a dependency. There may be a similar plugin for Ivy.

Upvotes: 0

Related Questions