3
votes

I'm trying to set Jenkins to work with Ant but I get the following error:

Started by user anonymous Building in workspace C:.jenkins\workspace\CI Demo Checking out a fresh workspace because there's no workspace at C:.jenkins\workspace\CI Demo Cleaning local Directory . Checking out https:///svn/CI_Demo/trunk at revision '2013-10-27T19:34:31.549 +0000'

At revision 6 [CI Demo] $ cmd.exe /C '"ant.bat jar && 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

however, JAVA_HOME, ANT_HOME and I added the following to "Path": %ANT_HOME%\bin;%JAVA_HOME%\bin

And as you can see the command is recognizable when executed in CMD:

C:\Users\Administrator>java -version java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

C:\Users\Administrator>ant -version Apache Ant(TM) version 1.9.2 compiled on July 8 2013

C:\Users\Administrator>ant.bat Buildfile: build.xml does not exist! Build failed

I would appreciate our help.

Thank you, N

4
Please check if you done this step: Go to Jenkins configuration "Manage Jenkins" and then "Configure System" and click the “Ant installations…” button in the Ant section. Add a new Ant and give it a name and point it to the ANT_HOME directory and Save.Michael Ver
Thank you, it wasn't set in the "configure system" section so I configured it, but the same problem continues...Blue

4 Answers

4
votes

Please set the JAVA_HOME, ANT_HOME, PATH at the Test Node Configuration page as below. While in your JOB Configuration page, make sure you restrict the job run in the correct Test Node and choose "DEFAULT" for your JDK and ANT VERSION. it shall working :D

enter image description here

0
votes

Changing the service of the Tomcat that was the Jenkins container from localhost to Administrator solved the problem

0
votes

You should make settings:

  • In windows
  • In Jenkins configuration
  • In Jenkins project

For concrete settings look at https://stackoverflow.com/a/23015039/715269

0
votes

Just go and install Ant In Workspace plugin