groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abc159abc (JIRA)" <>
Subject [jira] [Created] (GROOVY-8231) Getting syntax error when setting classpath with *
Date Thu, 15 Jun 2017 07:07:00 GMT
abc159abc created GROOVY-8231:

             Summary: Getting syntax error when setting classpath with *
                 Key: GROOVY-8231
             Project: Groovy
          Issue Type: Bug
          Components: command line processing
    Affects Versions: 2.4.11
         Environment: OS: Windows 10
JDK: 1.8.0_66 x64

            Reporter: abc159abc
            Priority: Minor

I am running a simple hello world style script.
The working directory has the following structure:

|-- lib
|   |-- commons-io.jar
|   `-- commons-lang3.jar
`-- src
    |-- Main.groovy
    `-- a
        `-- pkg
            `-- Hello.groovy

I am trying to run the following command:
groovy --classpath ".\lib\*;.\src" src\Main.groovy

The error I get is: "{color:red}The syntax of the command is incorrect.{color}"

Digging a little bit in the batch files called I traced the problem to bin\startGroovy.bat,
specifically in :win9xME_args_slurp.
In that block, there is an attempt to replace * in various situations however my case uses
\ (and /) which is not covered.
It seems to me that this is a rather common use case some I think it should be beneficial
to add the following 2 lines in the script:

set _ARGS=%_ARGS:/*=/-s%
set _ARGS=%_ARGS:\*=\-s%

This message was sent by Atlassian JIRA

View raw message