开发者

Ant : Passing username and password to exec

开发者 https://www.devze.com 2023-03-29 14:55 出处:网络
<exec dir=\".\" executable=\"osc\" failonerror=\"true\" failifexecutionfails=\"true\"> <arg line=\"-A ${obs.apiurl}/>
<exec dir="." executable="osc" failonerror="true" failifexecutionfails="true">  
    <arg line="-A ${obs.apiurl}/>
</exec>

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, an开发者_如何学编程y 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>

Here is the solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消