groovy

Windows start scripts have problems with -Dfoo=bar parameters

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.2, 1.6-rc-2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows without Cygwin or MSYS
  • Number of attachments :
    0

Description

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.

Issue Links

Activity

Hide
Paul King added a comment - - 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
Show
Paul King added a comment - - 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
Hide
Paul King added a comment -

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.

Show
Paul King added a comment - 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.
Hide
Paul King added a comment -

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.

Show
Paul King added a comment - 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.
Hide
Paul King added a comment -

close off release 1.5.4

Show
Paul King added a comment - close off release 1.5.4

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: