9

I have a plugin project which I created as grails create-plugin myPlugin. I also created a 'normal' grails project as grails create-app myPluginDemo. I'm trying to install myPlugin plugin in myPluginDemo but don't understand how to use grails.plugin.location.

Where do I put grails.plugin.location inside BuildConfig.groovy? Inside plugins section? Inside repositories section?

What should I append to grails.plugin.location? Should it be grails.plugin.location.myPlugin? Or grails.plugin.location.grails-my-plugin? Something else?

Jay Prall
  • 5,295
  • 5
  • 49
  • 79
zoran119
  • 10,657
  • 12
  • 46
  • 88

1 Answers1

22

grails.plugin.location is not a dependency resolution, so it goes outside grails.project.dependency.resolution.

It should be like below, if both myPluginDemo and myPlugin are in the same directory. Moreover, this will not install the plugin into the app, but the application will refer to the file system for the plugin which is convenient in development mode. In order to use the packaged plugin it has to be referred in plugins inside grails.project.dependency.resolution

grails.plugin.location.myPlugin = "../myPlugin"
grails.project.dependency.resolution = {
    repositories {

    }
    dependencies {

    }
    plugins {

    }
}
Beryllium
  • 12,808
  • 10
  • 56
  • 86
dmahapatro
  • 49,365
  • 7
  • 88
  • 117
  • 1
    So, what exactly does it mean for the plugin to be "not installed"? If I do this with my project, the plugin does appear among those installed in the `grails install-plugin` list. The app tries to compile the source files from the plugin if I do `grails compile` or `grails run-app`. So in what way is the plugin "not installed"? Will it not be packaged if I run `grails war`? – jonnybot Oct 01 '13 at 15:47
  • I am thinking that this is a use-case for using a CI system like Jenkins, am I right? – Thomas Farvour Nov 01 '13 at 15:59
  • 1
    @ThomasFarvour Nope, this practice is good during development. CI system like Jenkins should depend on the plugin as a dependency in the app and should not refer to a physical location in the CI build server. – dmahapatro Nov 01 '13 at 16:39
  • Ah. Thank you. I understand this now. I think we've been Doing It Wrong then. :( – Thomas Farvour Nov 01 '13 at 16:44