我对这个 ant 脚本有一个错误:
<path id="gwt-client.classpath">
<fileset dir="${src.dir}">
<include name="**/*.gwt.xml" />
</fileset>
<pathelement location="${gwt.client.dir}" />
<pathelement location="${gwt.shared.dir}" />
</path>
<path id="gwt-sdk.classpath">
<fileset dir="${gwt.sdk.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="gwt-compile" depends="prepareResources">
<property name="clientClasspath" refid="gwt-client.classpath" />
<echo message="==> gwt-client classpath = ${clientClasspath}" />
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<path refid="gwt-sdk.classpath" />
<path refid="gwt-client.classpath" />
</classpath>
<jvmarg value="-Xmx256M" />
<arg line="${gwt.module.name} -logLevel INFO -style PRETTY" />
</java>
</target>
虽然控制台告诉我很棒的事情:
[echo] ==> gwt-client classpath =
C:\code\repository\comments\src\io\robusta\fora\comments\Comments.gwt.xml;
C:\code\repository\comments\src\io\robusta\fora\comments\client;
C:\code\repository\comments\src\io\robusta\fora\comments\shared
所有这些文件都存在,但我有一个非常经典的错误:
[java] Loading inherited module 'io.robusta.fora.comments.Comments'
[java] [ERROR] Unable to find 'io/robusta/fora/comments/Comments.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
我倾向于认为我在 path、pathelement、refid 之间误用了 Ant 术语……或者错误消息应该寻找src/io/robusta/fora/comments/Comments.gwt.xml
而不是io/robusta/fora/comments/Comments.gwt.xml