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/