Ant :将用户名和密码传递给 exec [英] Ant : Passing username and password to exec

查看:30
本文介绍了Ant :将用户名和密码传递给 exec的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<exec dir="." executable="osc" failonerror="true" failifexecutionfails="true">  
    <arg line="-A ${obs.apiurl}/>
</exec>

如果用户第一次运行 osc 命令,Ant 将执行以下 osc,它要求用户输入用户名和密码.根据 ant 的文档,exec 任务中的任何用户输入都应以 EOF(-1) 结尾.

Ant executes the following osc which requires user to enter usename and password if user runs the osc command for the first time. According to ant's documentation, any user input in exec task should end with EOF(-1).

那么,如何将用户名和密码传递给可执行文件.

So, how to pass username and password to the executable.

推荐答案

<input message="Username : " addproperty="account">
</input>
<exec dir="." executable="/bin/sh" inputstring="${account}" failonerror="true" failifexecutionfails="true">
    <arg line="-c osc"/>
</exec>

这是解决方案.

这篇关于Ant :将用户名和密码传递给 exec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆