Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何让GWT编译多个模块?_Java_Gwt_Netbeans_Jakarta Ee - Fatal编程技术网

Java 如何让GWT编译多个模块?

Java 如何让GWT编译多个模块?,java,gwt,netbeans,jakarta-ee,Java,Gwt,Netbeans,Jakarta Ee,我在NetBeans 6.9中建立了一个新的GWT项目,并创建了多个GWT模块 我尝试将它们全部添加到gwt.properties文件中,如下所示: *# The names of the modules to compile (separated by a space character) gwt.module=com.company.MyModule1 com.company.MyModule2 com.company.MyModule3* 我在编译时遇到一个错误,说它找不到第二个

我在NetBeans 6.9中建立了一个新的GWT项目,并创建了多个GWT模块 我尝试将它们全部添加到gwt.properties文件中,如下所示:

  *# The names of the modules to compile (separated by a space character)
  gwt.module=com.company.MyModule1 com.company.MyModule2 com.company.MyModule3*
我在编译时遇到一个错误,说它找不到第二个模块。现在,我只能很好地编译一个模块。不管是哪一个。是我做错了什么,还是gwt/nbgwt中的一个bug

我也试过:

 *# The names of the modules to compile (separated by a space character)
  gwt.module=com.company.MyModule1
  gwt.module=com.company.MyModule2
  gwt.module=com.company.MyModule3*

在这种情况下,只编译列表中的最后一个模块。

您需要为每个模块创建一个gwt.xml文件

然后你可以用一个ANT任务编译它们

<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
        <classpath>
            <pathelement location="src"/>
            <path refid="project.class.path"/>
        </classpath>
        <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
        <arg value="${myModuleName}"/>
    </java>
</target>

您需要为每个模块创建一个gwt.xml文件

然后你可以用一个ANT任务编译它们

<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
        <classpath>
            <pathelement location="src"/>
            <path refid="project.class.path"/>
        </classpath>
        <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
        <arg value="${myModuleName}"/>
    </java>
</target>


我为每个模块创建了一个gwt.xml文件,它们被称为Module1.gwt.xml、Module2.gwt.xml等,它们都在com包中。company@Lucian:您是使用NetBeans还是ANT任务构建?构建的输出是什么?我正在使用Netbeans构建,我认为Netbeans正在使用ant构建所有东西。我对构建工具知之甚少。也许它使用了一个特定于GWT的构建工具。我的项目有一个名为gwt.properties的文件,其中包含gwt编译器的设置。在这个文件中,我尝试添加说明。现在,错误来自build-gwt.xml,它说我的模块不存在。官方支持Netbeans的gwt插件。Netbeans使用ant进行构建是对的,但我认为您混合了太多东西。我建议您使用Eclipse重复您的测试,一旦您知道它在受支持的环境中可以正常工作,那么如果您觉得在那里更舒服的话,您可以尝试回到Netbeans。另外,为什么您需要3个模块?我之所以尝试NetBeans,是因为我试图组合jsp文件在服务器端生成内容,然后使用GWT客户端代码对其进行操作。这样我的页面将被搜索引擎索引。现在,在eclipse中,我无法让服务器(在我的例子中是jetty)为我的jsp文件提供服务。我在Eclipse中编译多个模块时没有遇到任何问题。我已经为每个模块创建了一个gwt.xml文件,它们被称为Module1.gwt.xml、Module2.gwt.xml等,它们都在com包中。company@Lucian:您是使用NetBeans还是ANT任务构建?构建的输出是什么?我正在使用Netbeans构建,我认为Netbeans正在使用ant构建所有东西。我对构建工具知之甚少。也许它使用了一个特定于GWT的构建工具。我的项目有一个名为gwt.properties的文件,其中包含gwt编译器的设置。在这个文件中,我尝试添加说明。现在,错误来自build-gwt.xml,它说我的模块不存在。官方支持Netbeans的gwt插件。Netbeans使用ant进行构建是对的,但我认为您混合了太多东西。我建议您使用Eclipse重复您的测试,一旦您知道它在受支持的环境中可以正常工作,那么如果您觉得在那里更舒服的话,您可以尝试回到Netbeans。另外,为什么您需要3个模块?我之所以尝试NetBeans,是因为我试图组合jsp文件在服务器端生成内容,然后使用GWT客户端代码对其进行操作。这样我的页面将被搜索引擎索引。现在,在eclipse中,我无法让服务器(在我的例子中是jetty)为我的jsp文件提供服务。我在eclipse中编译多个模块时没有遇到任何问题