I encountered below issue when using Ant.
My ANT script snippets:
<path id="id.compile.classpath">
<pathelement location="src/compile_lib1/*" />
<pathelement location="src/compile_lib2/*" />
</path>
<javac srcdir="${module.root}/${src.root}" destdir="${swap.target.classes}"
nowarn="${javac.nowarn}" debug="${javac.debug}" fork="${javac.fork}"
classpathref="id.compile.classpath" includeAntRuntime="${javac.includeAntRuntime}">
<include name="**/*.java"/>
</javac>
When set fork=”true” in javac task, the wildcard pathelement works fine, but when forked is set to false, Ant seems failed to interpret wildcard correctly. (compilation failed, due to classpath error).
Any suggestions
Thanks.
Instead of using a wildcard pathelement, use a fileset and let Ant expand out the wildcard for you.
<path id="id.compile.classpath">
<fileset dir="src/compile_lib1" includes="*.jar" />
<fileset dir="src/compile_lib2" includes="*.jar" />
</path>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With