Grails
  1. Grails
  2. GRAILS-7066

dependsOn is not interpreted correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.5
    • Fix Version/s: 2.0 final
    • Component/s: None
    • Labels:
      None

      Description

      Plugin A has a dependency to plugin B. Plugin B is an inplac plugin.

      Now if you have defined the following dependency to your inplace plugin in your BuildConfig.groovy like this:

      def dependsOn = ["plugin-b":"0.1"]
      

      you get:

      Error: The following plugins failed to load due to missing dependencies: [pluginA]
      - Plugin: pluginA
         - Dependencies:
             - plugin-b (Required: 0.1, Found: 0.1)
      

        Activity

        Hide
        Malte Huebner added a comment -

        Ok, I figured it out now. This issue might also have to do soemthing with absolute and relative (transitive) in-place plugins an their paths. When I completely change the in-place plugin paths to a relative one everything seems to behave like it should. It's really hard to track down in a complex project structure.

        Show
        Malte Huebner added a comment - Ok, I figured it out now. This issue might also have to do soemthing with absolute and relative (transitive) in-place plugins an their paths. When I completely change the in-place plugin paths to a relative one everything seems to behave like it should. It's really hard to track down in a complex project structure.
        Hide
        eranlo added a comment -

        Not sure if this is directly related, but I have a problem where using an in-place plugin results in the war file missing the jar files in the plugin's lib directory.

        In my BuildConfig I have:
        grails.plugin.location.myPlugin= "../myPlugin"

        I also have myJar.jar under myPlugin/lib

        When I build the war file, myJar.jar is not in WEB-INF/lib

        I'm using grails 1.3.4. Is there a conflict between using in-place plugins and declaring dependencies in BuildConfig.groovy? Or between in-place plugins and declaring other plugins in application.properties?

        Show
        eranlo added a comment - Not sure if this is directly related, but I have a problem where using an in-place plugin results in the war file missing the jar files in the plugin's lib directory. In my BuildConfig I have: grails.plugin.location.myPlugin= "../myPlugin" I also have myJar.jar under myPlugin/lib When I build the war file, myJar.jar is not in WEB-INF/lib I'm using grails 1.3.4. Is there a conflict between using in-place plugins and declaring dependencies in BuildConfig.groovy? Or between in-place plugins and declaring other plugins in application.properties?
        Hide
        David Ayre added a comment -

        Same problem as Malte:

        My plugin has a dependency on jquery, but my grails app using the plugin can't resolve jquery when using the "grails.plugin.location.X" mechanism unless it's an absolute path. I would never have figured this out if it were not for Malte's comment above. The docs on specifying plugin locations (12.2) use a relative path in the example... which is what i used and works... only if your plugin itself does not have further dependencies (e.g. jquery).

        Grails plugin: A
        Grails application using plugin: B
        Both A and B projects reside under same directory: /Users/admin/Documents/workspace

        Plugin class for A (AGrailsPlugin.groovy):

         
        ... 
        def dependsOn = ['jquery':'1.4 > *']
        ...
        

        BuildConfig.groovy for B:

        grails.plugin.location.A = "../A"

        Results in the following error on run-app for B:

        Running script /Users/admin/Applications/springsource/grails-1.3.6/scripts/RunApp.groovy
        Environment set to development
          [groovyc] Compiling 1 source file to /Users/admin/Documents/workspace/B/target/classes
        - Plugin: A
           - Dependencies:
               ! jquery (Required: 1.4 > *, Found: Not Installed) [INVALID]
        

        When i change the BuildConfig parameter to use an absolute path, it works.

        Revised BuildConfig.groovy for B:

        grails.plugin.location.A = "/Users/admin/Documents/workspace/A"

        Not sure why a difference in absolute/relative path for an apps plugin resolution would affect dependency resolution for that plugins' dependency resolution (jquery).

        Show
        David Ayre added a comment - Same problem as Malte: My plugin has a dependency on jquery, but my grails app using the plugin can't resolve jquery when using the "grails.plugin.location.X" mechanism unless it's an absolute path. I would never have figured this out if it were not for Malte's comment above. The docs on specifying plugin locations ( 12.2 ) use a relative path in the example... which is what i used and works... only if your plugin itself does not have further dependencies (e.g. jquery). Grails plugin: A Grails application using plugin: B Both A and B projects reside under same directory: /Users/admin/Documents/workspace Plugin class for A (AGrailsPlugin.groovy): ... def dependsOn = ['jquery':'1.4 > *'] ... BuildConfig.groovy for B: grails.plugin.location.A = "../A" Results in the following error on run-app for B: Running script /Users/admin/Applications/springsource/grails-1.3.6/scripts/RunApp.groovy Environment set to development [groovyc] Compiling 1 source file to /Users/admin/Documents/workspace/B/target/classes - Plugin: A - Dependencies: ! jquery (Required: 1.4 > *, Found: Not Installed) [INVALID] When i change the BuildConfig parameter to use an absolute path, it works. Revised BuildConfig.groovy for B: grails.plugin.location.A = "/Users/admin/Documents/workspace/A" Not sure why a difference in absolute/relative path for an apps plugin resolution would affect dependency resolution for that plugins' dependency resolution (jquery).
        Hide
        Bobby Warner added a comment -

        I can't reproduce this relative path in-place plugin issue with Grails 2.0 Final. So, I recommend closing this issue.

        grails create-app foo
        grails create-plugin bar

        Edit: foo/grails-app/BuildConfig.groovy
        Add this line: grails.plugin.location.'bar' = "../bar"

        Edit: bar/BarGrailsPlugin.groovy
        Add this line: def dependsOn = ['jquery':'1.7 > *']

        Everything works (compile and run-app) successfully.

        Thanks,
        Bobby

        Show
        Bobby Warner added a comment - I can't reproduce this relative path in-place plugin issue with Grails 2.0 Final. So, I recommend closing this issue. grails create-app foo grails create-plugin bar Edit: foo/grails-app/BuildConfig.groovy Add this line: grails.plugin.location.'bar' = "../bar" Edit: bar/BarGrailsPlugin.groovy Add this line: def dependsOn = ['jquery':'1.7 > *'] Everything works (compile and run-app) successfully. Thanks, Bobby
        Hide
        Graeme Rocher added a comment -

        Thanks Bobby

        Show
        Graeme Rocher added a comment - Thanks Bobby

          People

          • Assignee:
            Unassigned
            Reporter:
            Malte Huebner
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development