Wednesday, October 31, 2012

Re: GWT, dependent projects, GWT Compiling, and deploying

I also have a "app" and a "common" project in Eclipse. Both are GWT enabled projects and "app" has "common" as a project dependency. Also the app.gwt.xml GWT module inherits common.gwt.xml.

When you compile "app" using the GWT compiler it will compile everything it sees starting from the module you compile. So if you compile "app" and it inherits "common" then "common" will be compiled to JavaScript as well and everything ends up in app-project/war/app. So as long as everything compiles without error, everything should be fine :)

If the common project also contains server side code, then you have to copy these server side classes to your .war file. So your build.xml file should include app-project/war/WEB-INF/classes AND common-project/bin (or common-project/war/WEB-INF/classes depending on your project setup) when building the war file. Otherwise your common server classes will be missing in the war file as Eclipse compiles the project's source to the classes folder of the corresponding project.

If you see a NoClassDefFoundException then you are missing server classes and you should fix your build.xml.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/t2XuzkRTwMsJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment