ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Mark Bram" <>
Subject Re: argument to ant at command line
Date Wed, 07 Jul 2004 02:14:18 GMT
Hi Sri,

> Can we pass a filename as an argument to ant instead of specifying it as  
> a
> arg value in <java> task.
> eg:
> ant build.xml filename

You can set properties on the command line which you can use inside an ant  
file. Like this:

<project name="Test" default="printArg" basedir=".">
    <target name="printArg">
          Filename arg: ${fileName}

And I run it in this fashion:

$ant -DfileName=pop
Buildfile: build.xml

      [echo]       Filename arg: pop

Total time: 3 seconds


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message