While troubleshooting a problem with apache-ivy, I want to call an ant target named -ivy-info defined in my build.xml. My -ivy-info target calls the ivy:info task and the ivy:buildnumber task and calculates the next revision number.
Problem is the ant command-line interprets the -ivy-info as a command-line option then fails with: Unknown argument: -ivy-info
One workaround I have found is to change the default target to -ivy-info via the first line of build.xml: <project name="my.project" default="-ivy-info">
and then run ant with no arguments, which works fine.
Other options are to rename the -ivy-info target so it does not start with a '-' character, or to create a new empty target with a name not starting with '-' and that includes -ivy-info as a dependency.
However I still want to know if there is any way that doesn't involve first editing build files?