Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.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
GWT1.7从ant构建文件编译_Gwt_Ant - Fatal编程技术网

GWT1.7从ant构建文件编译

GWT1.7从ant构建文件编译,gwt,ant,Gwt,Ant,我需要从我的ant构建文件中编译我的GWT1.7项目……有人知道怎么做吗 在GWT1.5中,我可以通过ant文件中的以下代码实现这一点: <target name="compile"> <exec executable="${root.dir}/HelloWorld-compile.cmd" failonerror="true"/> 以下是我用来在托管模式下运行和使用GWT1.7.1编译的一些ant目标 <property name="src.dir"

我需要从我的ant构建文件中编译我的GWT1.7项目……有人知道怎么做吗

在GWT1.5中,我可以通过ant文件中的以下代码实现这一点:

<target name="compile">
   <exec executable="${root.dir}/HelloWorld-compile.cmd"  failonerror="true"/>


以下是我用来在托管模式下运行和使用GWT1.7.1编译的一些ant目标

<property name="src.dir" value="src/main/java" />
<property name="build.dir" value="war" />

<path id="compile.classpath">
        <fileset dir="${build.dir}/WEB-INF/lib">
            <include name="**/*.jar" />
            <include name="**/*.xml" />
        </fileset>
    </path>

<target name="hosted" depends="javac" description="Starts gwt project in a standalone hosted browser and runs embedded jetty on port 8888">
            <java failonerror="true" fork="true" classname="com.google.gwt.dev.HostedMode">
                <classpath>
                    <pathelement location="${src.dir}" />
                    <path refid="compile.classpath" />
                </classpath>
                <jvmarg value="-Xms256M" />
                <jvmarg value="-Xmx256M" />
                <arg value="-startupUrl" />
                <arg value="index.html" />
                <arg value="com.gwt-example.ModuleName" />
            </java>
        </target>

<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.dir}" />
                    <path refid="compile.classpath" />
                </classpath>
                <jvmarg value="-Xmx256M" />
                <arg value="com.gwt-example.ModuleName" />
            </java>
        </target>

以下是我用来在托管模式下运行和使用GWT1.7.1编译的一些ant目标

<property name="src.dir" value="src/main/java" />
<property name="build.dir" value="war" />

<path id="compile.classpath">
        <fileset dir="${build.dir}/WEB-INF/lib">
            <include name="**/*.jar" />
            <include name="**/*.xml" />
        </fileset>
    </path>

<target name="hosted" depends="javac" description="Starts gwt project in a standalone hosted browser and runs embedded jetty on port 8888">
            <java failonerror="true" fork="true" classname="com.google.gwt.dev.HostedMode">
                <classpath>
                    <pathelement location="${src.dir}" />
                    <path refid="compile.classpath" />
                </classpath>
                <jvmarg value="-Xms256M" />
                <jvmarg value="-Xmx256M" />
                <arg value="-startupUrl" />
                <arg value="index.html" />
                <arg value="com.gwt-example.ModuleName" />
            </java>
        </target>

<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.dir}" />
                    <path refid="compile.classpath" />
                </classpath>
                <jvmarg value="-Xmx256M" />
                <arg value="com.gwt-example.ModuleName" />
            </java>
        </target>


Hi Dave,下面的人该怎么办:Dave,我现在得到以下信息:compile:[java]java.lang.NoClassDefFoundError:com/google/gwt/dev/Compiler[java]线程“main”中的异常似乎缺少对gwt JAR的引用。顺便说一句,这些都是windows上的。嗨,Rafael,听起来你好像错过了gwt DLL。确保gwt-ll.dll和swt-w32-3235.dll位于类路径上。在上面的示例中,ant脚本希望这些dll存在于war/WEB-INF/lib中。告诉ant在运行“java”cmd时在类路径中包含在“src/main/java”目录下找到的所有源代码${src.dir}是上面定义的ant属性。告诉ant在运行“java”命令时将所有内容包含在war/WEB-INF/lib下。在本例中,compile.classpath被定义为Hope that help.Hi Dave,下面的操作是什么:Dave,我现在得到以下内容:compile:[java]java.lang.NoClassDefFoundError:com/google/gwt/dev/Compiler[java]线程“main”中的异常似乎我错过了一个关于gwt罐子的参考。顺便说一句,这些都是windows上的。嗨,Rafael,听起来你好像错过了gwt DLL。确保gwt-ll.dll和swt-w32-3235.dll位于类路径上。在上面的示例中,ant脚本希望这些dll存在于war/WEB-INF/lib中。告诉ant在运行“java”cmd时在类路径中包含在“src/main/java”目录下找到的所有源代码${src.dir}是上面定义的ant属性。告诉ant在运行“java”命令时将所有内容包含在war/WEB-INF/lib下。在本例中,compile.classpath被定义为Hope,这会有所帮助。