Ant : Passing username and password to exec

只谈情不闲聊 提交于 2019-12-12 04:31:51

问题


<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, any user input in exec task should end with EOF(-1).

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


回答1:


<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.



来源:https://stackoverflow.com/questions/7146063/ant-passing-username-and-password-to-exec

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!