0

Based on the slide show at http://www.slideshare.net/kennethaliu/modularizing-your-grails-application-with-private-plugins-springone-2gx-2012 I am trying to modularize my app. To do it I have created a plugin called lms-core and added it in the same directory as main app's grails-app

For adding the dependency I have added following code in my buildconfig

    plugins {
         ...
        grails.plugin.location.LmsCore = "lms-core"
        grails.plugin.location.'lms-core' = "lms-core"
    }

I have tried the both ways show in the code with and without the dash(-) and I still get unable to resolve class compile error. These are the classes moved to the plugin. I have already gone through following questions without any solutions

How to run a local plugin in Grails 2.0?

http://grails.1312388.n4.nabble.com/Insert-own-local-plugin-into-build-config-td4646704.html

Community
  • 1
  • 1
Sap
  • 5,197
  • 8
  • 59
  • 101
  • You tried the absolute path? And while I'm here, have you tried installing it to your local maven cache and using the normal "name:version" syntax? – christopher Aug 31 '15 at 14:09
  • Yes I tried the absolute path like "E:\\folder\\folder" but then the plugin was outside of the parent app. No I haven't tried the maven because I am still developing the plugin where views are in the parent app and domain classes are in the plugin – Sap Aug 31 '15 at 14:20
  • That doesn't sound like an appropriate use of a plugin to me. A plugin is supposed to be a self contained piece of functionality. You might have a security plugin but I've never heard of someone putting their domain classes in a separate plugin. – christopher Aug 31 '15 at 14:24
  • Well, my scenario is exactly like in the slide show. The reason we are doing this is because we want to create two website with different views but same models. One view is for content creator/Admin while the other is for the user. – Sap Aug 31 '15 at 14:39
  • Okay. So can't you define the domain objects and release that instead? Honestly, I do think that publishing to a local DM cache is much better than hacking away with file locations. – christopher Aug 31 '15 at 15:23

1 Answers1

0

You must place the grails.plugin.location outside the plugins closure.

plugins {
         ...
}
grails.plugin.location.'lms-core' = "../lms-core" // Or wherever the location is
  • No luck with that too :( – Sap Sep 01 '15 at 07:17
  • Getting the same error when compiling bootstrap.groovy `E:\...\lms2.5\grails-app\conf\BootStrap.groovy: 2: unable to resolve class com.lms.User` – Sap Sep 01 '15 at 07:19