I have created an ant project which has some targets inside. One target is called info, which displays all available targets. This target is set as the default:
<project name="XXX" basedir="." default="info">
Now I want this target to be called in case of target not found:
Target "infp" does not exist in the project "XXX"
I need this in case the user calls a target that doesn’t exist. Then I want the info to be displayed, so that he sees all the available options.
Thanks
ANT does not support this functionality. The “default” target is called if no target is specified on the command line.
Instead I would suggest making your build self describing and teaching your users about ANT
‘s -p option.
Example
The following build file:
Can describe itself as follows: