你应该在src/com.myproject.blah一个项目的xml文件(我叫Setup.gwt.xml),它看起来像:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='setup'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<inherits name="com.some.external.library.Utils"/>
<!-- Specify the app entry point class. -->
<entry-point class='com.myproject.blah.client.Setup'/>
<stylesheet src="MyStyle.css"/>
</module>
build.xml文件中有一个部分:
<target name="libs" description="Copy libs to WEB-INF/lib">
<mkdir dir="war/WEB-INF/lib" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
<copy todir="war/WEB-INF/lib" file="/path/to/external/lib.jar" />
其中lib.jar包含从gwt.xml文件中引用的com.some.external.library.Utils源。关于第(3)点,如果外部库只使用GWT编译器知道的那个Java子集,那么你很好。
我不是100%确定以上是正确的,但它似乎确实对我有用。
来源
2010-07-14 04:21:24
BJB