Java 无法找到MyModule.gwt.xml,无法使用Ant编译gwt项目
此ant脚本有一个错误:Java 无法找到MyModule.gwt.xml,无法使用Ant编译gwt项目,java,gwt,ant,Java,Gwt,Ant,此ant脚本有一个错误: <path id="gwt-client.classpath"> <fileset dir="${src.dir}"> <include name="**/*.gwt.xml" /> </fileset> <pathelement location="${gwt.client.dir}" /> <pathelement location="${gwt.sha
<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>
所有这些文件都存在,但我有一个非常典型的错误:
[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和。。。或者错误消息应该查找
src/io/robusta/fora/comments/comments.gwt.xml
而不是io/robusta/fora/comments/comments.gwt.xml
我认为您误解了类路径的工作方式。classpath中的每个path元素都是一个根元素,完全限定名(包+类名)是根据该根元素解析的。这些路径可以是文件夹或档案(ZIP或JAR)
类位于C:\core\repository\comments\src
文件夹中的io.robusta.fora.comments.client
package live(在您的情况下)中。这是类路径中应该包含的内容
参考资料也是一样:io/robusta/fora/comments/comments.gwt.xml
在类路径中查找,因此,在您的例子中,C:\core\repository\comments\src
应该在类路径中,这样相对路径就可以正确解析为文件
[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?