Jenkins配置ant依赖问题

使用Jenkins集成ant构建Android项目遇到的问题:
cmd.exe /C “ant.bat release && exit %%ERRORLEVEL%%”
原因为Jekins配置ant依赖错误,解决方案如下(来自stackoverflow):
1.In windows:

ANT_HOME environment variable should be set to your ant install dir. If you haven’t such, download ant and unzip it.

第一步,在windows中设置ANT_HOME环境变量为ant安装目录

2.In Jenkins configuration

%ANT_HOME%\bin should be added to PATH
Go to Jenkins / Manage Jenkins / Configure System / Ant Installation.
Uncheck Install Automatically
Give name for Ant (AntName)
Put ant install dir into ANT_HOME
第二步:
1.将%ANT_HOME%加入环境变量
2.进入Jenkins-> 系统管理->Global Tool Configuration->设置Ant
3.反选自动安装,设置ant名称,将ant路径加入ANT_HOME

3.In Jenkins project

Got to Project/Configure/Build/Invoke Ant. (Add Build Step/Invoke Ant if you haven’t any). In Ant Version change Default to AntName (set by you in the Jenkins configuration)
第三步,进入自己配置的项目->配置->构建->invoke ant,将ant版本设置为第二步中设定的ant名称

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值