您好,我正在创建一个groovy脚本来自动构建和打包gwt应用程序。
AntBuilder被捆绑成Groovy的一部分,我真的很喜欢这个概念。它确实有助于提高生成的脚本的可读性。
但是,让我的脚本调用GWT编译器时遇到了一些问题。代码如下:
ant.sequential{
path( id:"gwt.path" , location:"src", { fileset (dir:"${GWT_HOME}", includes:"gwt-dev.jar" ) } )
ant.java ( fork:true, maxmemory:"256M", classpathref:"gwt.path", classname:"com.google.gwt.dev.Compiler"
, { classpath { pathelement location:"src" }
classpath { pathelement location:"${GWT_HOME}/gwt-user.jar" }
classpath { pathelement location:"${WEB_INF}/classes" }
arg (value:"-war")
arg (value:"bin/www")
arg (value:"com/xxx/xxx/xx/xxx/xxx/GWT_DuplicateFinder")
}
)
}据我所知,我已经正确地转换了等效的ant脚本(粘贴自用于另一个gwt项目的以前的build.xml文件。
<target name="web" depends="compile" description="GWT Web Compilation">
<mkdir dir="${gwt.web.out.dir}"/>
<java fork="true" maxmemory="256M" classpathref="gwt.path" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src"/>
<!-- Note the reference to the compiled java classes -->
<pathelement location="war/WEB-INF/classes"/>
</classpath>
<arg value="-war"/>
<arg value="bin/www"/>
<arg value="com/xxx/xxx/xx/xxx/xxx/GWT_DuplicateFinder"/>
</java>
</target>我得到的错误是:
[java] [ERROR] Unable to find 'com/xxx/xxx/xx/xxx/xxx/GWT_DuplicateFinder.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?谁能告诉我我哪里搞错了。
发布于 2012-01-30 19:02:04
由于GWT编译器看不到GWT_DuplicateFinder.gwt.xml文件,因此路径一定有问题。路径中确实有src文件夹,这很好。因此,可能基目录或工作目录不正确(或者根本没有设置)。
https://stackoverflow.com/questions/8549025
复制相似问题