if you have spaces in the target name, you will need to wrap them in quotation marks from the command line or the processor will treat them as multiple targets.
Try the following: build.xml:
<project name="MyProject" default="some target name" basedir="."> <target name="some target name"> <echo>reached some target name with spaces</echo> </target> <target name="some"> <echo>reached some</echo> </target> <target name="target"> <echo>reached target </echo> </target> <target name="name"> <echo>reached name</echo> </target> </project>
running ant some target name with spaces, you get the following:
Buildfile: build.xml some: [echo] reached some target: [echo] reached target name: [echo] reached name BUILD SUCCESSFUL Total time: 0 seconds
but with quotes, it is handled differently: ant "some target name"
Buildfile: build.xml some target name: [echo] reached some target name with spaces
source share