Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5805

@Grab must be followed by import

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.10, 1.8.1
    • Fix Version/s: 4.x
    • Component/s: parser
    • Labels:
      None
    • Environment:
      Windows, Ubuntu

      Description

      @Grab must be followed by an import statement - if not, there are compilation errors.

      Running this script:

      @Grab( 'log4j:log4j:1.2.16' )
      println "Hello"
      

      Yields this error:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      C:\work\CS\scripts\backup\hello.groovy: 2: unexpected token: println @ line 2, column 1.
         println "Hello"
         ^
      
      1 error
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ripper234 Ron Gross
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: