ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Clark" <>
Subject Re: Exec is failing, command line works fine
Date Tue, 02 Oct 2007 20:25:20 GMT
On Tuesday October 2, 2007, "Steve Middleton" 
<> wrote:
> I'm having a problem with an executable that seems to work fine
> from the command line, but does not work with the ant "exec" task.

When I run into this, I generally look at 3 things:

  - what directory is Ant executing the command in? Is it the 
    same as from the command line?
  - How is Ant passing the command line args? Is it the same as the
    shell would?
  - Are there any environment variable that are missing when run
    through Ant? There should not be, but you never know.

The first two can be determined by running your Ant build script with 
the -d (for debug) command line option. That will tell you exactly 
what command Ant is executing under the hood.

As a side note, I generally prefer to break up args into individual 
elements so there is no change of them being mis-parsed. So:

  <arg line="-B -f psbase.mak"/>

would be

  <arg value="-B"/>
  <arg value="-f"/>
  <arg value="psbase.mak"/>

but that's just a personal paranoia.

- Rob

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

View raw message