ant-user mailing list archives

Your java class is going to need to be able to input the password on STDIN I
believe.
Assuming you control 'Test2' (in your example) enough to make that happen,
then take a look at the input and inputstring propery of the java task, they
allow you to pass data in via STDIN. The best solution is to combine that
with the <input ...> task to prompt the user for the password at the time
you run ant.
Since I haven't used the java task I'll give you a heads up that my recent
use of inputstring in the exec class required that I compile the most recent
nightly build of 1.8.3 (inputstring wasn't implemented on the exec task
prior to a few weeks back), though hopefully in your case inputstring is
working as advertised in the docs for the java task.
David
-----Original Message-----
From: Muralidhar Manku [mailto:muralidhar.manku@gmail.com]
Sent: Thursday, July 07, 2011 8:37 PM
To: user@ant.apache.org
Subject: Hide password in java ant task
Hi All,
I am using ant java task to execute a class file and passing some argument
to it. one of the argument to this java class is the database password.
When the java task is getting executed, the entire command along with the
password is displayed in the process (ps -ef).
Is there any way to direct the java task to hide the password .
eg:
<target name="gentest" >
<java classname="Test2" fork="yes" failonerror="true">
<arg value="${DBuser}/${DBpsswd}"/>
<classpath>
<pathelement path="/u01/user2/patch/testjavac"/>
</classpath>
</java>
</target>
Note: Normally for other perl applications, we are passing the password as
a piped argument. Is there any similar feature in ant.
eg: { echo "password"; } | perl test.pl
Thanks,
Muralidhar
--
Muralidhar
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1388 / Virus Database: 1516/3749 - Release Date: 07/07/11
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org