I have self-hosted Windows agent with pre-placed Ant and it is placed under C:\Program Files\ant\ however, when I try to use Ant task:
- task: Ant@1
inputs:
buildFile: 'buildFiles\build.xml'
publishJUnitResults: false
antHomeDirectory: 'C:\Program Files\ant\'
javaHomeOption: 'JDKVersion'
I get error message "Unable to locate executable file: 'ant'" even though the file is there under 'C:\Program Files\ant\bin'. How do I need to define the path in order for the executable to be found?
ANT_HOME
as the Windows environment variable and point it to my Ant folder in the self-hosted Windows agent.%ANT_HOME%\bin
in the self-hosted Windows agent.ant
and ANT_HOME
.