ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KC Baltz <KBa...@responsenetworks.com>
Subject RE: Problem with <ARG>: ends up in wrong place?
Date Mon, 19 Mar 2001 13:46:28 GMT
You need to use <jvmarg> for -D arguments.  -D args are passed to the JVM,
not to your program directly.  

K.C.

> -----Original Message-----
> From: Mike Bridge [mailto:bridge@gsnet.com]
> Sent: Friday, March 16, 2001 5:52 PM
> To: ant-user@jakarta.apache.org
> Subject: Problem with <ARG>: ends up in wrong place?
> 
> 
> I have a problem with the "arg" entity within the "java" tag.  When it
> executes the jdk, it places the argument after the target class file, 
> rather than before.  Right or wrong, when I run this (at least with 
> IBM-JDK1.3), java doesn't recognize that anything has been passed
> to it with the "-D" argument.  However, if I type this from the 
> command line and put the "-D" BEFORE the class name, it works fine.
> 
> I also tried the deprecated "args" attribute, but that has the
> same problem.
> 
> Is this something that should be fixed within ant?  Or is there
> a workaround?
> 
> Here's the target from ant:
> 
>   <property name="configfileargs" 
> value="-Dmtl.config=file:///home/bridge/gsnet/WEB-INF/edm.dev.
> properties"/>
> ...
> 
>   <target name="test" depends="compile">
>      <java classname="com.gsnet.business.bo.TestIt" dir="." 
> fork="yes">
>         <classpath refid="project.class.path"/>
>         <arg line="${configfileargs}"/>
>      </java>
>   </target>
> 
> 
> And here's the result from "ant -verbose test"
> 
> test:
>      [java] Forking java -classpath 
> /home/bridge/gsnet/WEB-INF/classes/com/gsnet/business/bo:/home
> /bridge/gsnet/WEB-INF/classes:/usr/lib/pgsql/jdbc7.0-1.2.jar:/
home/bridge/gsnet/WEB->
INF/lib/log4j.jar:/home/bridge/gsnet/WEB-INF/lib/tlabs13.jar 
> com.gsnet.business.bo.TestIt 
> -Dmtl.config=file:///home/bridge/gsnet/WEB-INF/edm.dev.properties
> 
> Note that -Dmtl.config comes after "com.gsnet.business.bo.TestIt"....
> 
> Thanks,
> 
> -Mike
> 
> -- 
> Mike Bridge
> Global Sourcing Network
> http://www.gsnet.com/
> 

Mime
View raw message