Dónal
Dónal

Reputation: 187379

grails plugins compatibility

Can someone explain what exactly are the compatibility rules (in terms of Grails versions) for using Grails plugins in Grails applications.

My guess is that a plugin developed using Grails 2.X cannot be used in a Grails 1.X application even if the plugin doesn't use any features that are not available in the Grails 1.X application, is that correct?

Am I right in assuming that in this case, it should be possible to copy the source of the Grails 2.X plugin into an empty Grails 1.X plugin project, package it, and then use it in the Grails 1.X app?

Upvotes: 2

Views: 269

Answers (1)

Lauri Piispanen
Lauri Piispanen

Reputation: 2097

You are not correct. A plugin defines grailsVersion in its plugin descriptor, which dictates the Grails versions it works in:

// the version or versions of Grails the plugin is designed for
def grailsVersion = "1.1.1 > *"

Plugins are compiled during application startup (in dev environment) or during creation of a .war file. This means that plugins written against 2.x can indeed work in older versions, provided that they restrict themselves to using features supported in those versions.

Upvotes: 4

Related Questions