Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ant输入任务中防止回声_Ant - Fatal编程技术网

在ant输入任务中防止回声

在ant输入任务中防止回声,ant,Ant,如何防止ant的输入任务在控制台中回音/打印 在ant中请求输入时,它会在您键入时回显字符。这对于密码输入来说并不理想。我最终找到了一个解决方案 从Ant 1.7.1开始,这可以通过将处理程序设置为SecureInputHandler来实现,请参见下面的代码: <input message=" [input] password(Appserver):${line.separator}" addproperty="password"> <handle

如何防止ant的输入任务在控制台中回音/打印


在ant中请求输入时,它会在您键入时回显字符。这对于密码输入来说并不理想。

我最终找到了一个解决方案

从Ant 1.7.1开始,这可以通过将处理程序设置为SecureInputHandler来实现,请参见下面的代码:

<input
    message="    [input] password(Appserver):${line.separator}"
    addproperty="password">
    <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
奇怪的是,当您将处理程序设置为org.apache.tools.ant.input.SecureInputHandler时,它不会像其他输入那样显示:

它没有预先设置[input] 不将光标移动到下一行 因此,我通过修改消息实现了这两个目标,请参见上文。