1. Groovy
  2. GROOVY-4466

Parsing of the -cp argument appears to be broken in 1.7.5


    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.7.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:


      Consider the following script

      println org.apache.log4j.Category.class

      Save it as cp.groovy in a directory where the log4j jar isn't present (You can replace the log4j class with any class available in a jar that's handy, the issue is not specific to log4j and I've tested it with different libraries)

      Let's put the log4j library in c:\log4j-1.2.14.jar and invoke the script, setting the classpath:

      C:\work>groovy -cp c:\log4j-1.2.14.jar cp.groovy
      class org.apache.log4j.Category

      Now add another directory at the beginning of the classpath (a directory where, of course, the jar isn't present).

      C:\work>groovy -cp c:\temp;c:\log4j-1.2.14.jar cp.groovy
      Caught: groovy.lang.MissingPropertyException: No such property: org for class: cp

      The library is not recognized (and thus Groovy treats the fully qualified name as a chain of property accesses). I monitored file access with Sysinternals' FileMon and there's no attempt to read second jar.

        Issue Links


          Mark Thomas made changes -
          Workflow jira [ 12973684 ] Default workflow, editable Closed status [ 12980829 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12733402 ] Default workflow, editable Closed status [ 12745195 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Jochen Theodorou made changes -
          Assignee blackdrag blackdrag [ blackdrag ]
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          Paul King made changes -
          Field Original Value New Value
          Link This issue is related to GROOVY-5624 [ GROOVY-5624 ]
          Jean Luc created issue -


            • Assignee:
              Jochen Theodorou
              Jean Luc
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: