views:

249

answers:

4

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.

A: 

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.

Drew Wills
I'll take a look at that, but I'm still confused as to why this works with JSP/Servlets and not GWT, since the project structures are nearly the same which leads me to believe GWT is built on top of the Servlets framework.
Paul Gibler
+1  A: 

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

ChadNC
A: 

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:

http://stackoverflow.com/questions/483563/eclipse-buildpath-automatically-taking-all-jars-of-a-internal-directory/483641

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

insipid
I might go with this route. I am still really confused as to why this works automatically with JSP/Servlets and not GWT. Maybe it has to do with how the JSP/Servlets plugin is written.
Paul Gibler
Edited post to include why.
insipid
+3  A: 

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.

Pascal Thivent
Thanks, that makes sense. Too bad though :)
Paul Gibler