Is there a way to mask the password when using the <input .../> task in ANT from the Eclipse IDE?
I see a way to do it from the command line:
<input message="secure-input:" addproperty="the.password">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
But this doesn’t work in eclipse.
EDIT : As ant secure Input handler still doesn’t work in eclipse 4.x, here’s a solution based on ant script task, working with builtin javascript engine (since JDK 1.6.0_06), so no extra libraries needed :
The method JPasswordField.getText() is deprecated,
normally you would use getPassword(), but it doesn’t work.
takes only the chararray, whereas :
results in :
maybe a bug in the javascript engine !? (using jdk 1.7.0_60)
Since version 1.7.1 Ant has support for Java 1.6’s secure console input feature, see Ant Manual. What version of Eclipse and Java do you use ? Alternatively you may use :
AntForms which has a lot of input dialogs and support for passwords too
or
Jera Ant Tasks which has a query task with optional password masking
EDIT : adding a specific example using groovy..
You may use a scripting language to open a dialog, here is an example using Groovy =
Finally write your own Inputhandler, see http://sourceforge.net/projects/emaria/files/antdocs/antinput/antinput.pdf/download for details