1

この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?

私はパス、パス要素、refid の間の Ant 用語を間違って使用していると思う傾向があります... またはエラーメッセージはsrc/io/robusta/fora/comments/Comments.gwt.xml代わりに探す必要がありますio/robusta/fora/comments/Comments.gwt.xml

4

1 に答える 1

3

I think you're misunderstanding how the classpath works. Each path element in the classpath is a root against which fully-qualified names (package + class name) are resolved. Those paths can be either folders or archives (ZIPs or JARs).

Classes in the io.robusta.fora.comments.client package live (in your case) in the C:\core\repository\comments\src folder. This is what should be in the classpath.

Same for resources: io/robusta/fora/comments/Comments.gwt.xml is looked up in the classpath, so, in your case, C:\core\repository\comments\src should be in the classpath so that the relative path can be correctly resolved to the file.

于 2013-09-15T11:55:28.460 に答える