Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Grails Plugin? What does it mean to Install a Plugin?

I used Grails recently, and added Grails plugin for JQuery, but I don't think it did anything more than just copy some jQuery files over.

So far, I have seen info only on 'how to install and use' plugins...but I can't find anything that describes the concept of a plugin.

Can somebody please tell me, what is a Grails Plugin? And what does it mean to 'Install' a plugin?

like image 295
rk2010 Avatar asked May 23 '11 16:05

rk2010


People also ask

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.

Where are Grails plugins stored?

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


1 Answers

A Grails plugin is (or should be) a self-contained bundle of functionality that can be installed into a Grails application. When a Grails plugin is installed, it can do any of the following:

  • define additional Spring beans
  • modify the generated web.xml
  • add new methods to the application's artefacts (controllers, domain classes, services, etc.)
  • provide new tag libraries
  • make additional resources and classes available to the application
  • provide new Grails commands

For example, when you install the JQuery plugin

  • the JQuery JavaScript files are added to the application
  • a new Grails tag <jq:jquery> is added to the application
  • a new Grails command grails install-plugin jquery is added to the application

When you install a Grails plugin, that plugin's functionality is made available to the installing application. However, the plugin itself is not actually copied into the application, only the plugin name and version is added to the application's application.properties file. The plugin itself is downloaded to $HOME/.grails and the application loads it from there.

The structure of a Grails plugin project is identical to that of a Grails application, with the exception of a configuration file (known as a plugin descriptor) that is included in a plugin's root directory.

like image 83
Dónal Avatar answered Sep 28 '22 01:09

Dónal