Summary: | Blank jvmargs attribute value in java task causes java.lang.NoClassDefFoundError | ||
---|---|---|---|
Product: | Ant | Reporter: | daniel.hall |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | NEW --- | ||
Severity: | normal | CC: | jglick |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: | Patch consolidating Brian's changes and Jan's testcase |
Description
daniel.hall
2010-02-25 11:24:01 UTC
there is a patch attached t bug 43586 which is supposed to fix this. I'm not sure whether disallowing any blank args in jvmargs would be a good thing or whether there may be any legitimate reasons to have literal blank args - like a blank classpath as companion to a -classpath argument. Maybe we should print a warning if we encounter blank args that makes debugging such a situation easier. This way we won't give up the flexibility we currently allow. (In reply to comment #0) > It is useful to be able to pass in arguments which may or may not be blank as a > jvmarg You can use line="${possiblyBlank}". Unfortunately this assumes that ${possiblyBlank} contains no spaces. Best would be the ability to pass if/unless attrs (or nested <condition>s) on <arg> variants. I agree with Jesse that if and unless on jvmargs, and also on <arg/> inside <exec/> and <java/> would be ideal. Regards, Antoine (In reply to comment #2) > (In reply to comment #0) > > It is useful to be able to pass in arguments which may or may not be blank as a > > jvmarg > > You can use line="${possiblyBlank}". Unfortunately this assumes that > ${possiblyBlank} contains no spaces. This is a good workaround for the current bug report. What I meant was something different, though. The patch attached to bug 43586 would remove all blank command line arguments and I argued this would be going too far since there might be legitimate reasons for a blank arg. > Best would be the ability to pass > if/unless attrs (or nested <condition>s) on <arg> variants. Agreed. I thought there must already be a bugzilla issue for this, but can't find one. Created attachment 25339 [details]
Patch consolidating Brian's changes and Jan's testcase
I have modified Brian's original change to use a linked list rather than a vector and a two-element string array rather than a map, but these changes are really minor.
(In reply to comment #5) > Created an attachment (id=25339) [details] wrong issue, sorry. |