Ant load property file and pass value as arg when exec java file -


how can load value property file , pass arg when want execute java file?

the content file of aa.properties: home_path=c:/myhome/apps

the ant:

<target name="tst">   <property file="aa.properties"/>     <property name="homepath" value="${home_path}/"/>       <java classpathref="clspath" classname="com.mytest.myapp" fork="true">         <arg value="${homepath}"/>       </java> </target> 

you pass other argument java task via nested arg values or arg line
note vmargs f.e. -dwhatever=foobar passed jvmarg java task

f.e. propertyfile aa.properties looks :

vmarg.foo=-dsomevalue=whatever arg.key=value arg.foo=bar ... 

ant then

<target name="tst">  <property file="aa.properties"/>  <property name="homepath" value="${home_path}/"/>  <java classpathref="clspath" classname="com.mytest.myapp" fork="true">   <jvmarg value="${vmarg.foo}"/>   <arg value="${homepath}"/>   <arg value="${arg.key}"/>   <arg value="${arg.foo}"/>   ...  </java> </target> 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -