2

I'm building both a Grails app as well as a plugin that the app will use as a dependency. I need a way to make changes to the plugin, publish it locally, build the app (using the new version of the plugin - SNAPSHOT) and then do a grails run-app to pick up all the changes.

I also need a way to publish the plugin to a remote Artifactory repo and have the Grails app pick up the "release" (non-SNAPSHOT) version of the plugin. Any ideas as to how I could accomplish this?

AdjustingForInflation
  • 1,571
  • 2
  • 26
  • 50

1 Answers1

6

While the plugin is under development, make it a local plugin, so that you don't have to redeploy to a repo after every change. For example, for a plugin named 'shiro' whose source code is at /dev/plugins/grails-shiro, add the following to Config.groovy

grails.plugin.location.shiro = "/dev/plugins/grails-shiro"

When a version of the plugin is ready to be released, use the release plugin to deploy it to a remote repo.

Community
  • 1
  • 1
Dónal
  • 185,044
  • 174
  • 569
  • 824
  • Thanks @Don (+1) but based on that other answer of yours (using Shiro) I'm still not sure exactly how/where to make this configuration. Did you put this `grails.plugin.location.shiro = "/home/dilbert/dev/plugins/grails-shiro"` in application.properties, BuildConfig.groovy, or somewhere else? How does the Groovy build know to use this abspath instead of the local .m2 cache? Thanks again! – AdjustingForInflation Apr 15 '14 at 12:17
  • And also, how do you switch back and forth between local/snapshot and release? – AdjustingForInflation Apr 15 '14 at 12:20
  • @TotesMcGotes I've updated my question to answer your first question. To switch between using a released version of a plugin and a local version you need to edit `Config.groovy` and `BuildConfig.groovy` – Dónal Apr 15 '14 at 13:58