Steve Loughran wrote:
> Frederic Chalons wrote:
>
>> Hi,
>>
>> My problem involved the attribute jvmarg set to a property which
>> value is ""...
>>
>> Using Ant 1.6.4, I am using the java task to launch various process:
>>
>> / <java classname="${classname}">/
>> / <arg value="${arg1}" />/
>> / <arg value="${arg2}" />/
>> / <jvmarg value="${jvmarg1}" />/
>> / <jvmarg value="${jvmarg2}" />/
>> / </java>/
>>
>> For each class the properties (arg1, arg2, jvmarg1, jvmarg2,etc. )
>> are loaded from xml file.
>> After that, for each undefined property, its value is set to "".
>> As a property cannot be overwritten, it behaves as defining a default
>> value.
>>
>> This is working fine as long as jvmarg1 & jvmarg2 properties have a
>> value but breaks when they use "" as default value.
>> Running ant -debug gives the following:
>>
>> /''/
>> /''/
>>
>> /The ' characters around the executable and arguments are/
>> /not part of the command./
>> / [java] Exception in thread "main"
>> java.lang.NoClassDefFoundError:/
>>
>> /BUILD FAILED/
>>
>> It seems that empty jvmarg is the caused but I need to find a way to
>> inhibit jvmarg attribute when the associated property is not used.
>
>
> Alternatively, you need a default JVM argument that can be used
> multiple times and has no side effects, and make that the default.
>
> the -ea option to enable assertions for a package may work there...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
Hi Steve,
Thank you for your insight.
By the way, I was given another workaround by defining a system property
as default value.
ex: <property name="arg1" value="-Dtoto="titi" />
This not very elegant but it works as a charm :-)
Regards,
Frederic
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|