You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Hawkins, Keith" <KH...@us.nomura.com> on 2003/02/10 17:19:49 UTC

Executing keytool within ant

Hello,

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?

Thanks,
Keith





Here is my target in my build.xml

<target name="generate_certificate">
		<exec
executable="C:\FiSys\VendorSoftware\Java\j2sdk1.4.1\bin\keytool">
			<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"/>
		</exec>
</target>


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

build.xml
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 =
file:C:/FiSys/Modules/FSCU/Src/build.xml
Project base dir set to: C:\FiSys\Modules\FSCU\Src
Loading C:\FiSys\Modules\FSCU\Src\build.properties
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,
deployToWeblogicServer]
generate_certificate
exec
Current OS is Windows 2000
Executing 'C:\FiSys\VendorSoftware\Java\j2sdk1.4.1\bin\keytool' with
arguments:
'-genkey'
'-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]

-----  This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. If
you receive this message in error, please delete it and all copies from your
system, destroy any hard copies and notify the sender. You must not,
directly or indirectly, use, disclose, distribute, print, or copy any part
of this message if you are not the intended recipient. Nomura Holding
America Inc., Nomura Securities International, Inc, and their respective
subsidiaries each reserve the right to monitor all e-mail communications
through its networks. Any views expressed in this message are those of the
individual sender, except where the message states otherwise and the sender
is authorized to state the views of such entity. Unless otherwise stated,
any pricing information in this message is indicative only, is subject to
change and does not constitute an offer to deal at any price quoted. Any
reference to the terms of executed transactions should be treated as
preliminary only and subject to our formal written confirmation.