ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Executing keytool within ant
Date Mon, 10 Feb 2003 16:41:11 GMT
Lookup  the manual for differences between <arg value="" /> and <arg line=""
/>. --DD

-----Original Message-----
From: Hawkins, Keith [] 
Sent: Monday, February 10, 2003 10:20 AM
To: ''
Subject: Executing keytool within ant


When I try to run keytool via an ant executable target, it complains about
arguments saying that they are invalid when they are not.  If I run the
command outside of ant, it works fine.   Has anyone gotten keytool to run as
part of an ant target?


Here is my target in my build.xml

<target name="generate_certificate">
			<arg value="-v" />
			<arg value="-genkey"/>
			<arg value="-alias fscu" />
			<arg value='-dname "CN=SysApps, OU=MBS, O=Nomura
Securities, L=New York, ST=New York,C=US"  ' />
			<arg value="-keypass secret"/>
			<arg value="-keystore ${src.dir}/fscu.keystore"/>
			<arg value="-storepass secret"/>

Here is the output from executing the target in ant.  Note how it complains
that -alias is an illegal argument when it isn't

Detected Java version: 1.4 in: C:\FiSys\VendorSoftware\IntelliJ-IDEA-3.0\jre
Detected OS: Windows 2000
parsing buildfile C:\FiSys\Modules\FSCU\Src\build.xml with URI =
Project base dir set to: C:\FiSys\Modules\FSCU\Src
Loading C:\FiSys\Modules\FSCU\Src\
Build sequence for target `generate_certificate' is [generate_certificate]
Complete build sequence is [generate_certificate, clean, prepare,
do_compile, build_webstart_patch, signjar, do_createwar, compile, do_jarall,
jarall, pf-jar-generic-ejb, fscu-jar-generic-ejb, create-tbapricer-jar,
do_earApplication, sign_weblogic_jar, fscu-ejbc, pf-ejbc, do_signjars,
signjars, createwar, earApplication, do_deployToWeblogicServer,
Current OS is Windows 2000
Executing 'C:\FiSys\VendorSoftware\Java\j2sdk1.4.1\bin\keytool' with
'-alias fscu'
'-dname "CN=SysApps, OU=MBS, O=Nomura Securities, L=New York, ST=New
York,C=US"  '
'-keypass secret'
'-keystore ./fscu.keystore'
'-storepass secret'

The ' characters around the executable and arguments are
not part of the command.

Illegal option:  -alias fscu
keytool usage:

-genkey      [-v] [-alias <alias>] [-keyalg <keyalg>]
	     [-keysize <keysize>] [-sigalg <sigalg>]
	     [-dname <dname>] [-validity <valDays>]
	     [-keypass <keypass>] [-keystore <keystore>]
	     [-storepass <storepass>] [-storetype <storetype>]
	     [-provider <provider_class_name>] ...

[Rest of the keytool usage text deleted]

View raw message