ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Balakrishna <...@yahoo.com>
Subject Difficulty calling a batch file on windows with <exec>- requires use of '.bat' extension
Date Wed, 21 Mar 2001 20:31:56 GMT
Hi.

Summary
-------
I am uable to call a Windows batch script (say
test.bat) from ANT by leaving out the '.bat' extension

Detail
------ 

I am trying to create a common build.xml file for both
Windows NT and for Solaris. I have a problem with one
of my targets requiring a workaround.

<target name="install_ear">
    <exec executable="${ias.bin}/iasdeploy">
      <arg line="${ear}"/>
    </exec>
</target>

I have a program iasdeploy.bat on Windows NT and
iasdeploy on Solaris which should get invoked from
this target. However, that does not happen. On
Windows, I get the following error which requires me
to explicity use 'iasdeploy.bat' as my executable
target

Error
----
BUILD FAILED

D:\iPlanet\ias-samples\helloworld\src\build.xml:175:
Execute failed: java.io.IOException: CreateProcess:
d:\iplanet\ias6\ias/bin/j2eeappreg ../helloworld.ear 
error=2
java.io.IOException: CreateProcess:
d:\iplanet\ias6\ias/bin/j2eeappreg ../helloworld.ear 
error=2
	at java.lang.Win32Process.create(Native Method)
	at
java.lang.Win32Process.<init>(Win32Process.java:64)
... etc ...

Workaround
-----------
The workaround involves using the "os" attribute. Is
there any way to avoid this and have one common
section that will work on all OS?

<target name="install_ear">
<exec executable="${ias.bin}/iasdeploy" os="SunOS">
<arg line="${ear}"/>
</exec>

<exec executable="${ias.bin}/iasdeploy.bat"
os="Windows NT">
<arg line="${ear}"/>
</exec>
</target> 




__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Mime
View raw message