Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a local plugin in Grails 2.0?

In Grails, there is a variant how to include local plugin from sources. According to docs, one may type in BuildConfig.groovy:

// Useful to test plugins you are developing.
grails.plugin.location.shiro =
        "/home/dilbert/dev/plugins/grails-shiro"

// Useful for modular applications where all plugins and
// applications are in the same directory.
grails.plugin.location.'grails-ui' = "../grails-grails-ui"

The problem is that it doesn't work in Grails 2.0.RC1. I've tried to do grails clean, to install plugin with grails install-plugin and to place it to BuildConfig.groovy. Still unable to resolve.

like image 208
Dmitry Kurinskiy Avatar asked Nov 16 '11 13:11

Dmitry Kurinskiy


People also ask

Where are Grails plugins stored?

By default the plugins are in . grails/<version>/<project>/plugins . You can change it by setting grails. project.

What is a Grails plugin?

Grails plugin which allows you to view files stored on the file system.


2 Answers

This works for me

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

Where shiro is the name of the plugin (not the name of the directory it's in). Make sure the path to the plugin is either an absolute path or the relative path to the plugin from the application.

I've found that this sometimes doesn't work if the plugin is listed in application.properties or BuildConfig.groovy, so if it is, remove it, then execute grails clean and restart the app.

like image 114
Dónal Avatar answered Sep 28 '22 20:09

Dónal


You can also install the plugin into your local maven cache.

The documentation speaks about this:

3.7.10 Deploying to a Maven Repository

maven-install

The maven-install command will install the Grails project or plugin artifact into your local Maven cache:

grails maven-install

This has the advantage of allowing you to include the plugin in your parent application using the more common ":plugin-name:version" syntax

Which allows your application to determine the best place to retrieve the plugin when in production. From an internal maven-repo or equivalent.

like image 27
stevecowling Avatar answered Sep 28 '22 21:09

stevecowling