Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute ant using a batch file?

I have installed ant and it runs successfully in cmd. I know that when you want to use ant, you can enter the destination path and execute ant in command line. This works fine for me. But when I create a batch file to run ant in the destination path. It tells me that ant is not recognized as an internal or external command, operable program or batch file.

So here is what I want to know: how to execute ant in a batch file or is there another way to run it without entering cd command all the time?

like image 651
surunzi Avatar asked Jan 13 '23 02:01

surunzi


2 Answers

"c:\directory\where\ant\is\ant" -buildfile "d:\directory\where\your\build.xml\is\"

like image 58
MC ND Avatar answered Jan 18 '23 17:01

MC ND


call ant -f %BUILDXML_LOC% -lib %ANTUNITLIB_HOME%

The above command must work. Just give it a try.

Where %BUILDXML_LOC% is the location where you have your build.xml file and %ANTUNITLIB_HOME% is the location where you have placed your ant-antunit-1.2.jar and additional jars required

like image 20
YeahIam Avatar answered Jan 18 '23 18:01

YeahIam