Grails
  1. Grails
  2. GRAILS-6282

Grails does not pick up scripts provided by plugins declared in 'plugins' section of dependency DSL

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3 final
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None

      Description

      Let's say I want to use the Maven Publisher plugin to publish my own plugin. Based on the behaviour of applications, one might think that adding it to the dependencies in BuildConfig.groovy should work:

      plugins {
          build ":maven-publisher:0.5"
      }
      

      But it doesn't. When I execute grails maven-install, Grails says it can't find the MavenInstall script. After I have run grails run-app, the maven-install command becomes available.

        Activity

        Hide
        Peter Ledbrook added a comment -

        Actually, this may be more of an issue of when plugins are resolved. If I try the same syntax with an application and then try to run grails maven-install, Grails complains that it can't find the MavenInstall script. I'm not sure when Grails resolves new plugins using the dependency DSL, but it doesn't seem to do it at the right time.

        Show
        Peter Ledbrook added a comment - Actually, this may be more of an issue of when plugins are resolved. If I try the same syntax with an application and then try to run grails maven-install , Grails complains that it can't find the MavenInstall script. I'm not sure when Grails resolves new plugins using the dependency DSL, but it doesn't seem to do it at the right time.
        Hide
        Graeme Rocher added a comment -

        Well we would have to move the plugin resolution up into GrailsScriptRunner before script execution to do this and I don't see how that is possible because much of the install logic is in Gant scripts

        Show
        Graeme Rocher added a comment - Well we would have to move the plugin resolution up into GrailsScriptRunner before script execution to do this and I don't see how that is possible because much of the install logic is in Gant scripts
        Hide
        Peter Ledbrook added a comment -

        This is a tough one. What we could do is schedule this for Grails 2.0 instead (Gradle would make implementing this easier I believe) and recommend that people explicitly install build-time plugins. Unfortunately, this wouldn't help much with something like Shiro which provides its own scripts but also adds runtime behaviour. For such situations, users could declare the plugin dependency in the DSL and simply be aware that the additional commands won't be available until the plugin has actually be installed. A case of educating our users.

        Show
        Peter Ledbrook added a comment - This is a tough one. What we could do is schedule this for Grails 2.0 instead (Gradle would make implementing this easier I believe) and recommend that people explicitly install build-time plugins. Unfortunately, this wouldn't help much with something like Shiro which provides its own scripts but also adds runtime behaviour. For such situations, users could declare the plugin dependency in the DSL and simply be aware that the additional commands won't be available until the plugin has actually be installed. A case of educating our users.

          People

          • Assignee:
            Unassigned
            Reporter:
            Peter Ledbrook
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development