Grails
  1. Grails
  2. GRAILS-6453

Grails cannot compile a script if it references classes from a plugin

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.1, 1.3.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      If you have script that references classes from a plugin it won't compile. You get class not found.

      This seems to be because the GrailsScriptRunner only loads on classes from the applications classesDir. Now that pluginClasses are stored in in a seperate pluginClassesDir scripts which reference plugin classes won't compile.

      I'd suggest the GrailsScriptRunner adds pluginClasses to the class loader in addition to the application classes.

      Kev

        Activity

        Hide
        Luke Daley added a comment -

        Can you please provide a setup that exhibits this issue.

        I know the problem exists, it will just make it easier to verify that the issue is solved if I have a sample to work with.

        Show
        Luke Daley added a comment - Can you please provide a setup that exhibits this issue. I know the problem exists, it will just make it easier to verify that the issue is solved if I have a sample to work with.
        Hide
        Patrick Liechty added a comment -

        Here is an example. This Groovy class references the Selenium WebDriver Grails plugin. Of course we get compilation errors.

        Show
        Patrick Liechty added a comment - Here is an example. This Groovy class references the Selenium WebDriver Grails plugin. Of course we get compilation errors.
        Hide
        Samuel Doyle added a comment -

        I'm getting a case where the main application is trying to compile the classes already compiled in the custom plugin and failing because these classes have a dependency on a plugin which is defined only in the custom plugin

        Show
        Samuel Doyle added a comment - I'm getting a case where the main application is trying to compile the classes already compiled in the custom plugin and failing because these classes have a dependency on a plugin which is defined only in the custom plugin

          People

          • Assignee:
            Unassigned
            Reporter:
            Kevin Richards
          • Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development