Thursday, December 4, 2014

Effective Grails plugin development with in-place plugins

Plugins are a great way to modularize your applications and reuse common functionalities. The first time I tried to write a plugin my development process was annoying and time-consuming, because I didn't know about in-place plugins.

My workflow consisted of the following steps, which have to be repeated every time:
  1. change some plugin code
  2. grails package-plugin
  3. grails install-plugin
  4. grails run-app
  5. check plugin changes in main app

So I didn't use plugins for structuring the code for a while, until I found out about in-place plugins, where you can skip a lot of the unnecessary work.

Configure main application for your in-place plugin

You need a plugin under development and a main application where you would like to use it. There you just add the following to your BuildConfig.groovy:
grails.plugin.location."${pluginName}" = "${pathToYourPlugin}"

Replace the plugin name placeholder with your plugin name and the path to the root directory of your plugin. Check "Specifiying Plugin Locations" in the grails docs Creating and Installing Plugins for further information.

Example for my AdminPanelPlugin used by the AdminTest application:
grails.plugin.location."AdminPanelPlugin" = "/Users/surelyplus/Documents/workspace/AdminPanelPlugin"

Even IntelliJ has great support for this, so you can see the plugin next to your main app in the Grails View.

Hope this helps you writing more plugins with more fun ( -> like me)!


  1. I would like to help me to know how a plugin structure, i cant use the controller of a plugin in another plugin mi email is

  2. Its loyalty program helps the brand stand out from the crowd. Hard Rock is a globaly brand with 카지노 사이트 lots of of properties around the globe together with cafes, casinos and resorts. Its on line casino product delivers every thing that a participant may anticipate type such a brand.

  3. If your components or finish product require welding becoming a member of elements Freediving Snorkel or materials together, robotic welding is the high-quality alternative on your job. This automatic welding technique can produce extremely correct, constant results in a short time frame. Sheet steel stamping is when formations are made in the steel simultaneously or utilizing a progressive die.