Siva Kumar Reddy G
Siva Kumar Reddy G

Reputation: 1274

Jenkins + Ant build error

[Project1] $ cmd.exe /C '"ant.bat && exit %%ERRORLEVEL%%"'
'ant.bat' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE

I already set env variables ANT_HOME, JAVA_HOME and PATH variables. But still i am getting above error.

I am using windows 8 OS.

Upvotes: 0

Views: 10963

Answers (3)

Sergii Fasolko
Sergii Fasolko

Reputation: 318

Go to Jenkins => Manage Jenkins => Global Tool Configuration and add an Ant installation and check the box "Install automatically".

Upvotes: 0

Kamila Brito
Kamila Brito

Reputation: 198

You probably have this solved by now but I'm going to share my answer to this problem anyway. It might help others in the future. I've had this EXACT problem (my jenkins was a remote server) and I solved it by creating the node on server again and downloading the slave one more time. But I had to do this FROM THE CLIENT'S machine. For some reason, jenkins was getting information from the machine I was creating the nodes and using it as the path. So yeah, thats the solution. Crate your node again from the client's machine.

Upvotes: 0

sti
sti

Reputation: 11075

You could go to Jenkins global configuration (Manage Jenkins => Configure system) and add an Ant installation and check the box "Install automatically".

In your job you could then use the Ant built step.

This way Jenkins downloads Ant, installs it into its private tool directory and calls it from there.

Upvotes: 4

Related Questions