0

How can I show Ant that libraries exist in two different directories?

Right now I have

<property name="lib" value="C:/apache-ant-1.8.4/lib" />

    <target name="compile" depends="init">
        <javac source="1.6" srcdir="${src}" fork="true" destdir="${bin}" encoding="UTF-8" >
            <classpath>
                <pathelement path="${bin}">
                </pathelement>
                <fileset dir="${lib}">
                    <include name="**/*.jar" />
                </fileset>
            </classpath>
        </javac>
    </target>

It's fine if I copy all the libs to the ant \lib folder. How can I show Ant that there are two directories with libraries?

4

1 に答える 1

1

別のファイルセットを追加するだけです:

<property name="lib" value="C:/apache-ant-1.8.4/lib" />
<property name="otherLib" value="C:/somePath/lib" />


<target name="compile" depends="init">
    <javac source="1.6" srcdir="${src}" fork="true" destdir="${bin}" encoding="UTF-8" >
        <classpath>
            <pathelement path="${bin}" />
            <fileset dir="${lib}">
                <include name="**/*.jar" />
            </fileset>
            <fileset dir="${otherLib}">
                <include name="**/*.jar" />
            </fileset>
        </classpath>
    </javac>
</target>
于 2012-08-03T10:30:57.350 に答える