How does ant behave if I define a path with a pathelement which points to a non-existent directory?
<path id="foo.bar">
<pathelement location="this/might/not/exist/">
</path>
The scenario is that the ant file is used for several projects - some have this additional folder, and some do not.
Does ant just ignore it, or does it fail?
It depends on the context.
When used as a classpath for the
javac
task, the missing directories are simply ignored:But if you use a path containing a non-existent directory, say as the source for a
copy
, you'll get an error. For example, here directories 'one' and 'three' exist, but 'two' does not:You could use a
dirset
to filter out the missing items perhaps: