Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding in-place plugin to grails 3 project

In grails 2.x, we were allowed to add an in place plugin by adding following in BuildConfig.groovy

grails.plugin.location."my-plugin" = "../my-plugin"

My question is, can we add our local plugins similarly in-place in grails3.0 as well or there is some other way to do this in grails.

Actual purpose is to test the plugin whether it's working properly or not before pushing it to bintray.

like image 974
Vinay Prajapati Avatar asked Feb 06 '16 12:02

Vinay Prajapati


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 plugin in Grails?

A Grails plugin project is just like an application project except it contains a plugin descriptor and can be packaged as a plugin and installed into other applications. Plugins are not just useful for plugin developers, but also as a way to modularize large Grails applications.


1 Answers

Yes, there is. Grails 3 is based on Gradle so multi-project gradle builds solve your issue.

Basically you add dependency as: compile project(':../my-custom-plugin') and has to modify settings.gradle to include plugin: include '../my-custom-plugin'

Check Grails documentation on Plugins and Multi-Project Builds in http://grails.github.io/grails-doc/latest/guide/plugins.html

Other way is to install plugin in local maven repository using gradle publishToMavenLocal command and resolve if from there, before publishing to Bintray or other dependency repository.

Additionally since Grails 3.1.1, reloading is now supported for 'inline' plugins. Check https://github.com/grails/grails-core/releases/tag/v3.1.1 and http://grails.io/post/138665751278/grails-3-gradle-multi-project-builds

It is done using grails { plugins { syntax. Copied from docs:

grails {
    plugins {
        compile ":hibernate"
        compile project(':myplugin')
    }
}
like image 179
droggo Avatar answered Sep 17 '22 22:09

droggo