ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: arg and jvmarg
Date Wed, 16 Apr 2008 11:27:47 GMT
Dave Pawson wrote:
> On 11/04/2008, Rick Genter <> wrote:
>>  > I seem to have found just the opposite?
>>  > line="-o filename" works fine, but as was pointed out,
>>  > if I want to use value I have to use two arg elements?
>> Your example has 2 arguments: '-o' and 'filename'. I recommend reading
>>  the documentation for the command line processor you are using for how
>>  it processes command lines and what the definition of an 'argument' is.
> Saxon XSLT processor.
> -o filename is the parameter. I'd always thought of it as one param.
> Name (-o)
> value (filename)
> Ant seems to view it differently.

Its two separate parameters when you break up the command line by 
spaces, which is what C main(char **argv)  does by the time every native 
program gets a look in. And The Java Runtime exec() call takes the same 
list of arguments, which is what ant sets up

When you go <arg line> ant splits up the line by spaces, and gets it 
wrong when there are spaces in filenames -just as the shell would. When 
you build it up using <arg value>, spaces in filenames get handled 

If you build on on unix, you may not notice these problems, but other 
developers may hit the problem. Its safest, therefore, to use arg value, 
except in the special case that you want people who override your build 
file to include a whole list of custom arguments (like custom JVM 


Steve Loughran        
Author: Ant in Action 

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

View raw message