我正在尝试像这样从命令行(无 Ant/Maven)从我的项目中编译 GWT
java -cp "/home/user/gwt-2.8.2/*:/home/user/myapp/src:/home/user/myapp/lib/*" com.google.gwt.dev.Compiler com.myapp.webservices.SpwrWebServices
但抛出错误
Loading inherited module 'com.myapp.webservices.SpwrWebServices'
Loading inherited module 'gwt.material.design.GwtMaterialWithJQuery'
Loading inherited module 'gwt.material.design.GwtMaterialDesignBase'
[WARN] Line 40: Setting configuration property named 'CssResource.legacy' in module 'gwt.material.design.GwtMaterialDesignBase' that has not been previously defined
[ERROR] Line 18: Unable to load class 'com.myapp.webservices.client.util.GitCommitGenerator'
java.lang.ClassNotFoundException: com.myapp.webservices.client.util.GitCommitGenerator
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.google.gwt.dev.cfg.ModuleDefSchema$ClassAttrCvt.convertToArg(ModuleDefSchema.java:899)
at com.google.gwt.dev.util.xml.HandlerArgs.convertToArg(HandlerArgs.java:64)
at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:221)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:296)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:349)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$200(ReflectiveParser.java:70)
at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:431)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:316)
at com.google.gwt.dev.cfg.ModuleDefLoader.load(ModuleDefLoader.java:243)
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:193)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:151)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:126)
at com.google.gwt.dev.Compiler.compile(Compiler.java:139)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:125)
我确实有该文件src/com/myapp/webservices/client/util/GitCommitGenerator.java
,所以我不明白我的这个错误是否显示。我的 gwt config xml 文件看起来像这样
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "\s">
<module rename-to= "SpwrWebServices">
<inherits name="com.google.gwt.user.User" />
<!-- GwtMaterialWithJQuery module is smaller and should be used for production code -->
<!-- <inherits name="gwt.material.design.GwtMaterialWithJQuery" /> -->
<!-- GWTMaterialWithJQueryDebug This module is larger and includes non-minified source for easier debugging -->
<!-- GWT Material -->
<inherits name="gwt.material.design.GwtMaterialWithJQuery"/>
<inherits name="gwt.material.design.addins.GwtMaterialAddins"/>
<inherits name="org.fusesource.restygwt.RestyGWT" />
<inherits name='com.googlecode.gwt.charts.Charts'/>
<inherits name="org.moxieapps.gwt.uploader.Uploader"/>
<set-property name="gwt.logging.enabled" value="TRUE"/>
<set-property name="gwt.logging.logLevel" value="INFO"/>
<generate-with class="com.myapp.webservices.client.util.GitCommitGenerator">
<when-type-assignable class="com.myapp.webservices.client.util.GitCommit"/>
</generate-with>
<source path="client" />
<!-- <source path ="shared" /> -->
<entry-point
class="com.myapp.webservices.client.SpwrWsEntryPoint" />
<set-property name="user.agent" value="gecko1_8,safari"/>
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
</module>
上面的配置有什么问题,我怎样才能得到一个干净的编译?