Issue Details (XML | Word | Printable)

Key: GROOVY-1767
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Paul King
Reporter: Russel Winder
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

Windows start scripts have problems with -Dfoo=bar parameters

Created: 06/Mar/07 04:45 AM   Updated: 08/Feb/08 01:26 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.2, 1.6-rc-2

Time Tracking:
Not Specified

Environment: Windows without Cygwin or MSYS
Issue Links:
Related
 


 Description  « Hide
When starting Gant (or Groovy?) with a command line such as:

gant -Dfoo=bar create

on Windows such that the batch files are used (i.e. no Cygwin or MSYS to provide a Posix shell) then it seems that the startGroovy.bat file is "called" with a parameter -Dfoo=bar but the final java invocation has parameters:

-Dfoo bar

the = sign is replaced with a space.

I am informed that quoting on the command line cures the problem:

-D"foo=bar"

but I have not tested this, I am just reporting from emails.

This definitely seems to be a startGroovy.bat problem though – the Posix shell scripts have no problem.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 19/Jan/08 08:28 AM - edited
The following works for me with HEAD on Windows (native installer and cygwin after latest patch) and Linux but fails under Windows with .bat startup:
groovy -Dtest.prop=abc -e "println System.getProperty('test.prop')"
// => abc

Paul King added a comment - 21/Jan/08 12:50 AM
I have applied a patch which improves this area (e.g. makes the above example work) but isn't perfect. Windows tries to glob usages of * which is only worked around for simple cases. Perhaps enough to consider this working for 1.5.x and we move to native launcher for 1.6.

Paul King added a comment - 25/Jan/08 06:50 AM
I believe this is fixed and has been merged onto 1.5.2. I haven't tried it with gant at this stage. Please re-open if you have troubles with gant.

Paul King added a comment - 08/Feb/08 01:26 AM
close off release 1.5.4