Gobliins
Gobliins

Reputation: 4026

Adding folders with libs in ant buildfile

in my Project i have the /lib and /WEB-INF folder. I would need to add both folders (or the .jar files from those folders with sub folders) to the classpath.

I tried something like this, but it didnt work:

<property name="lib.dir"        value="lib"/>
<property name="webinf.dir"     value="WEB-INF"/>

<path id="classpath">
    <fileset dir="${lib.dir}">
        <include name="${lib.dir}/**/*.jar ${webinf.dir}/**/*.jar"/>
    </fileset>
</path>

Upvotes: 0

Views: 406

Answers (1)

Szarpul
Szarpul

Reputation: 1571

You can try this:

<property name="web-inf.dir" value="WEB-INF" />
<property name="lib.dir" value="lib" />

<path id="classpath">
    <fileset dir="${web-inf.dir}" includes="**/*.jar" />
    <fileset dir="${lib.dir}" includes="**/*.jar" />
</path>

But shouldn't the web-lib dir be something like webContent\WEB-INF\lib? If yes, then web-inf.dir should be:

<property name="web-inf.dir" value="webContent/WEB-INF/lib" />

Upvotes: 1

Related Questions