The problem is, for things like passwords we'd really like to not have Ant echo what we're typing.
It turns out that in Ant 1.7.1 they added a "SecureInputHandler" which does this (it takes advantage of some things in Java 1.6). It's not documented, exactly, but its in there:
<target name="input-test" >
<input message="username:>" addproperty="username" defaultvalue="lalala" />
<input message="password:>" addproperty="password">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<echo message="username= ${username}" />
<echo message="password= ${password}" />
</target>
No comments:
Post a Comment