【发布时间】:2014-07-02 20:46:12
【问题描述】:
我正在尝试设置 Jenkins 以构建 GWT 项目,但出现此错误
gwt-compile-module:
[java] Jul 01, 2014 2:08:59 PM java.util.prefs.FileSystemPreferences$1 run
[java] INFO: Created user preferences directory.
[java] Loading inherited module 'OBFUSCATE'
[java] [ERROR] Unable to find 'OBFUSCATE.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
我在类路径中有 gwt-user.jar、gwt-dev.jar、validation-api-1.0.0.GA-sources.jar 和 validation-api-1.0.0.GA.jar。
OBFUSCATE.gwt.xml 必须是某个 GWT 基础模块,但在任何地方都找不到。
这是来自 build.xml 的 sn-p:
<target name="gwt-compile-module" description="Build one GWT module - java to javascript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement location="${build.dir}"/>
<path refid="project.classpath"/>
</classpath>
<jvmarg value="-Xmx1024M"/>
<arg value="-optimize"/>
<arg value="${optimize}"/>
<arg value="-localWorkers"/>
<arg value="${localWorkers}"/>
<arg value="-war" />
<arg value="${gwt.output.dir}" />
<arg value="${draftCompile}" />
<arg value="${gwt.modules}${gwt.module}"/>
<arg line="-style OBFUSCATE"/>
</java>
</target>
【问题讨论】:
-
显然问题是由传递给 GWT 编译器的参数“-style OBFUSCATE”引起的。当我在 Eclipse 中运行 ant 构建时效果很好,但是在 Jenkins GWT 中运行时认为它是一个模块。
-
不同版本的 Ant 有不同的行为? (假设您使用的是 Ant)从调用 GWT 编译器的构建脚本中发布 sn-p。