[
https://issues.apache.org/jira/browse/GROOVY-7378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14507010#comment-14507010
]
ASF GitHub Bot commented on GROOVY-7378:
----------------------------------------
GitHub user jwadamson opened a pull request:
https://github.com/apache/incubator-groovy/pull/5
GROOVY-7378: Support JAVA_OPTS containing quoted arguments on *nix
Apply the previously provided patch for GROOVY-7378.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jwadamson/incubator-groovy master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-groovy/pull/5.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5
----
commit b9c907a5a5b453eca6aeea1b73d3d950e20ad3e4
Author: Jeffrey Adamson <[email protected]>
Date: 2015-04-22T12:44:13Z
GROOVY-7378: Support JAVA_OPTS containing quoted arguments on *nix
----
> Spaces in JAVA_OPTS env var prevent launching of groovy
> --------------------------------------------------------
>
> Key: GROOVY-7378
> URL: https://issues.apache.org/jira/browse/GROOVY-7378
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.3
> Environment: Linux
> Reporter: Jeffrey Adamson
> Attachments: startGroovy.patch
>
>
> Set environment variable JAVA_OPTS to have a system property including
> spaces/quotes/double-quotes.
> $ export JAVA_OPTS="-Dfoo='bar\" baz\"'"
> $ groovy -e 'println System.getProperty("foo"); println args' 'arg space'
> "space quote' " "\""
> Expected output would be:
> 'bar" baz"'
> [arg space, space quote' , "]
> Actual output is:
> Error: Could not find or load main class baz"'
> I can not comment on proper way to fix startGroovy.bat (assuming it suffers
> similarly), but included is diff that fixes startGroovy unix script to handle
> JAVA_OPTS such that quoted arguments are preserved as expected.
> I modeled the attached change which seems to resolve the issue for *nix on
> the tomcat `catalina.sh run` script block.
> p.s. A concrete use case that bit me was trying to pass java.io.tmpdir to a
> groovy script to a path that included a space. There are outside reasons that
> modifying the script to read the desired value and set the system property is
> not a practical solution.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)