ANT任务以包含GWT的源文件



我试图在GWT框架内使用:http://code.google.com/p/jspf/。我知道GWT需要包含的类的源代码。我已经将jspf的代码放在{SRC_DIR}中,并且我的build.xml包含以下条目:

 <path id="project.class.path">
    <pathelement location="${basedir}/src" />
        <fileset dir="${war_lib_dir}" includes="**/*.jar" />
    <pathelement location="${javac_precompile_classes_dir}" />
 </path>

但是当我运行ant任务时,它失败了:

[echo] Starting GWTC
    [java] Compiling module com.x.y.z
    [java]    Validating newly compiled units
    [java]       [ERROR] Errors in 'file:/u/v/XyzClass.java'
    [java]          [ERROR] Line 201: No source code is available for type net.xeoh.plugins.base.util.JSPFProperties; did you forget to inherit a required module?
    [java]          [ERROR] Line 203: No source code is available for type net.xeoh.plugins.base.PluginManager; did you forget to inherit a required module?
    [java]          [ERROR] Line 208: No source code is available for type net.xeoh.plugins.base.impl.PluginManagerFactory; did you forget to inherit a required module?
    [java]          [ERROR] Line 209: No source code is available for type net.xeoh.plugins.base.util.uri.ClassURI; did you forget to inherit a required module?
    [java]          [ERROR] Line 211: No source code is available for type com.netapp.sysmgr.plugin.SysmgrPlugin; did you forget to inherit a required module?
    [java]    Finding entry point classes

build.xml中的片段

<target name="javac" depends="libs" description="Compile server java source and any other required files">
<echo>Compiling server source</echo>
<mkdir dir="${war_classes_dir}" />
<javac srcdir="${basedir}/src" includes="**/server/**/*.java" encoding="utf-8" destdir="${war_classes_dir}"
    source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
    <classpath>
        <path refid="project.class.path" />
    </classpath>
</javac>
<echo>Pre-compiling vendor specific source</echo>
<mkdir dir="${javac_precompile_classes_dir}" />
<javac srcdir="${basedir}/src" includes="**/vendor/**/*.java" encoding="utf-8" destdir="${javac_precompile_classes_dir}"
    source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
    <classpath refid="project.class.path" />
</javac>

GWT需要源代码,因为它要将其编译为JavaScript。这些错误是因为您在应用程序的客户端中使用了未组织在模块文件(.gwt.xml文件)中的源代码,或者您没有继承模块文件。这就是错误所指的:did you forget to inherit a required module。仅仅添加源代码并不能帮助GWT找到源代码,还必须有一个模块文件。

为了能够使用这些源,必须有一个模块文件存在,或者你必须自己创建并在你的模块文件中继承它。以下是关于模块的文档:http://code.google.com/intl/nl-NL/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModules尽管文档对如何为这种情况创建自己的模块文件有些简要

相关内容

  • 没有找到相关文章