{project}.gwt.xml not found in the war

49 views
Skip to first unread message

tong123123

unread,
Aug 23, 2012, 1:05:06 AM8/23/12
to google-we...@googlegroups.com
I just note this today, In the attached file, {project}.gwt.xml is under {project} folder, but when after package, this {project}.gwt.xml is not presented in the .war!! but the war can successfully deploy and run, why the war can still run and why the output war has no {project}.gwt.xml file?
gwt.xmlPlacement.png

Jens

unread,
Aug 23, 2012, 6:16:11 AM8/23/12
to google-we...@googlegroups.com
I just note this today, In the attached file, {project}.gwt.xml is under {project} folder, but when after package, this {project}.gwt.xml is not presented in the .war!! but the war can successfully deploy and run, why the war can still run and why the output war has no {project}.gwt.xml file?

The gwt.xml file is only for the GWT compiler as it tells the GWT compiler what to compile and how to do code generation / deferred binding. Once your app is compiled to JavaScript you don't need that file anymore to run the app and thats why you don't need it inside your war.

You only need gwt.xml files inside a jar if you plan to use this jar as library for a different GWT app and you want to inherit some module.gwt.xml files from it. In that case the jar must contain the source java files + module.gwt.xml (class files are not needed as the GWT compiler works on Java source files).

-- J.

Thomas Broyer

unread,
Aug 23, 2012, 6:34:11 AM8/23/12
to google-we...@googlegroups.com


On Thursday, August 23, 2012 12:16:11 PM UTC+2, Jens wrote:
(class files are not needed as the GWT compiler works on Java source files).

Actually, the GWT compiler works from *both* the source and compiled classes: when annotations refer to other classes (such as CssResource's @Import, PlaceHistoryMapper's @WithTokenizers, Bean validation's @GwtValidation and @ServerConstraint, or RequestFactory's @ProxyFor and @Service), those are looked up in the classpath. See http://code.google.com/p/google-web-toolkit/issues/detail?id=7602

Jens

unread,
Aug 23, 2012, 7:22:19 AM8/23/12
to google-we...@googlegroups.com

Actually, the GWT compiler works from *both* the source and compiled classes: when annotations refer to other classes (such as CssResource's @Import, PlaceHistoryMapper's @WithTokenizers, Bean validation's @GwtValidation and @ServerConstraint, or RequestFactory's @ProxyFor and @Service), those are looked up in the classpath. See http://code.google.com/p/google-web-toolkit/issues/detail?id=7602

Ah right, forgot that one. Stumbled upon this quite some time ago while using custom annotations on shared classes that refer to server classes (similar to @ProxyFor).

-- J.
Reply all
Reply to author
Forward
0 new messages