ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Need help write task:
Date Thu, 23 Oct 2003 19:18:01 GMT
Hello all:

I am trying to write an ant task but can't seem to get Execute to run my 
command line.  Specifically, it can't find the executable and returns the 
following error:

Execption thrown: CreateProcess: cvs -n status 
C:/repository/b_code_cleanup/source/clientware/Random/build.xml error=2

If I hard code the path in the 
setExecutable("c:\development\cvs\bin\cvs.exe") then everything works.
CVS is part of my PATH so I can't seem to figure out why it's not found. I 
also tried setting the environment but this did not help either.

Here is what my code looks like.  Can anyone explain why exe.execute() is 
unable to run cvs?

Code snipit:

File destDir = project.getBaseDir();

cmdLine.createArgument().setValue(destDir.toString() + "/build.xml");
ByteArrayOutputStream out = new ByteArrayOutputStream();
Execute exe = new Execute(new PumpStreamHandler(out));

        int iReturn = exe.execute();

( please ignore the disclamer ... company policy )

This communication is intended solely for the addressee and is
confidential. If you are not the intended recipient, any disclosure, 
copying, distribution or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. Unless indicated
to the contrary: it does not constitute professional advice or 
opinions upon which reliance may be made by the addressee or any
other party, and it should be considered to be a work in progress.

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

View raw message