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

@Grab must be followed by import

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7.10, 1.8.1
    • 4.x
    • parser
    • None
    • 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

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

            Dates

              Created:
              Updated: