问题
I am specifying jvm arguments since i was getting out of heap space exception so just to avoid that i was specifying the below parameters in my ant target that is as shown below..
<junit
printsummary="true"
fork="yes"
haltonfailure="false"
failureproperty="junitsFailed"
errorProperty="junitsFailed"
>
<jvmarg value=" -Xmx1024m -Duser.timezone=GMT0"/>
</junit>
but below i am getting the below exception ..
that is the invalid parameters are specified
回答1:
Use multiple <jvmarg> elements:
<junit printsummary="true" fork="yes" haltonfailure="false" failureproperty="junitsFailed" errorProperty="junitsFailed">
<jvmarg value="-Xmx1024m"/>
<jvmarg value="-Duser.timezone=GMT0"/>
</junit>
回答2:
You can set ANT_OPTS parameters. For example in Windows
SET ANT_OPTS=-Xmx1024m -XX:MaxPermSize=256m
or just use maxmemory attribute of junit ant task (http://ant.apache.org/manual/Tasks/junit.html):
<junit maxmemory="1024m" ...
来源:https://stackoverflow.com/questions/25039864/specifying-jvm-arguments-in-ant-tasks