I've inherited an Ant build system that contains many resource set definitions like this:
<files id="app1.lib.jars">
<include name="${java}/jre/lib/jsse.jar"/>
<include name="${work.lib}/jtidy.jar"/>
...
</files>
<files id="app2.lib.jars">
<include name="${work.lib}/itext.jar"/>
<include name="${work.lib}/commons-httpclient.jar"/>
...
</files>
<files id="app3.lib.jars">
<include name="${work.lib}/jdom.jar"/>
<include name="${ant.lib}/ant.jar"/>
...
</files>
There are perhaps a dozen of these, and each can contain anywhere from
5 to 50 files. The problem is that I'm reworking this system to use
Ivy for dependency management, and in the process some of the
references now point to non-existent files. Unfortunately, Ant does
not provide any help finding these bad pointers. When these resource
collections are used to define a classpath any <include...>
tags
pointing to missing files are silently ignored.
I thought I could force an error by using the collections as the
source of a <copy...>
, but even with failonerror="true"
it just
ignored the bad references.
The command-line -v
(verbose) and -d
(debug) option didn't help
either. The output acknowledged that some were missing but didn't
actually show them
[echo] app1.lib.jars
[copy] C:\dev\src\tomcat6\work\java\jre\lib\jsse.jar omitted as C:\dev\src\tomcat6\work\verify\jsse.jar is up to date.
[copy] C:\dev\src\tomcat6\work\lib\axis-ant.jar omitted as C:\dev\src\tomcat6\work\verify\axis-ant.jar is up to date.
...
[copy] No sources found.
[echo] app2.lib.jars
...
For a one-time solution I extracted all the filenames from the resource sets in the Ant file and compared that to a directory listing of the result of copying all the files (in Ant) into a temporary directory, after appropriate sorting.
Question: Is there a way to get Ant to tell me when a resource points to a missing file, preferably at the time the resource is defined?