How to run ant build in jenkins?

2.3k Views Asked by At

Please look into the screenshot below

SS

SS

Am trying to execute in the batch command! what am I making a mistake?

set DYNAMO_HOME=C:/ATG/ATG11.3.2/home
echo DYNAMO_HOME
D:/Users/aswad/Downloads/apache-ant-1.9.15-bin/apache-ant-1.9.15/bin/ant build-atg-ear
2

There are 2 best solutions below

0
TechGiant On

The build is failed due to - 'java.exe' in not recognised.
To solve this you need to add 'bin' folder of Java installation directory to 'PATH' environment variable. e.g. if Java is installed at C:/Java then there need to be an entry 'C:/Java/bin' in PATH.

0
CAustin On

Don't run Ant as part of a Windows batch script. Instead, use the Jenkins plugin that is dedicated to this task. Go to Manage Jenkins -> Manage Plugins -> Available and search for Ant Plugin.

After it's installed, go back to your job configuration and select a new build step Invoke Ant.