蚂蚁构建文件中的番石榴



我正在使用Google的Guava库,特别是Class Sets。我尝试用 Ant 构建我的程序,但它失败了。来自javac的错误是

找不到符号 [javac] 符号:变量集合。

番石榴在类路径中。在这里,我附上我的构建.xml

<project name="projekt" basedir="." default="">
    <property name="product.name"    value="Petrinet editor"/>
    <property name="product.version" value="1.0"/>
    <property name="build"           value="build"/>
    <property name="java.encoding"   value="utf8" />
    <path id="build.classpath"> 
        <pathelement location="bin"/>
        <pathelement location="lib/guava-11.0.2.jar"/>
        <pathelement location="lib/jgraphx.jar"/>
    </path>
<!-- ===================== Project Environment =========================== -->
    <property name="source.home"    value="${basedir}/src"/>
    <property name="example.home"   value="${basedir}/examples"/>
<!-- ==================== Target: clean ==================== -->
    <target name="clean">
        <delete dir="build"/>
        <delete dir="dest-client"/>
        <delete dir="dest-server"/>
        <delete dir="doc"/>
    </target> 
<!-- ==================== Target: compile ==================== -->
    <target name="compile">
        <mkdir dir="build"/>
        <mkdir dir="build/client"/>
        <mkdir dir="dest-client"/>
        <javac srcdir="src" encoding="${java.encoding}" destdir="build/client" includeantruntime="false">
            <exclude name="**/server/*"/>
            <classpath refid="build.classpath" />
        </javac>
        <copy todir="dest-client/lib">
            <fileset dir="lib"/>
        </copy>
        <jar basedir="build/client" destfile="dest-client/ija2012-client.jar">
            <manifest>
                <attribute name="Main-Class" value="main.Client"/>
            </manifest>
        </jar>
        <mkdir dir="build/server"/>
        <mkdir dir="dest-server"/>
        <javac srcdir="src" destdir="build/server" includeantruntime="false">
            <exclude name="**/main/*"/>
            <exclude name="**/filter/*"/>
        </javac>
        <copy todir="dest-server/lib"><fileset dir="lib"/></copy>
        <jar basedir="build/server" destfile="dest-server/ija2012-server.jar">
            <manifest>
                <attribute name="Main-Class" value="server.Server"/>
            </manifest>
        </jar>
        <mkdir dir="doc"/>
        <javadoc sourcepath="src" destdir="doc" author="true" version="true" use="true" windowtitle="Sitovy editor Petriho siti">
        <doctitle><![CDATA[<h1>Síťový editor Petriho sítí</h1>]]></doctitle>
            <bottom><![CDATA[Síťový editor Petriho sítí (c) 2012 xbabic06, xbabic07]]></bottom>
        </javadoc>
    </target>
</project>

构建客户端或服务器时是否发生编译失败?您可以在客户机的类路径中包含番石榴,但不包括服务器的类路径。

相关内容

  • 没有找到相关文章

最新更新