How to upgrade Grails 2 applications and plugins to Grails 3

How to upgrade Grails 2 applications and plugins to work with Grails 3


 The Grails framework is a web framework for developing dynamic websites. It has been recently upgraded to version 3.0 and the upgrade has introduced breaking changes. According to the grails documentation, Grails 3.0 is a complete ground up rewrite of Grails and introduces new concepts and components for many parts of the framework.

The 'rewrite' part means that a lot has changed, including class packages.

This means that your plugin will break if it imports any of the Grails API packages that have been moved.

Although the Grails documentation provides a guide for upgrading applications and plugins, it does not provide information about all the Grails API package changes.


To save software development time, please find some of the package changes below.

Grails 2 Grails 3
org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap grails.web.servlet.mvc.GrailsParameterMap
org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes org.grails.web.util.GrailsApplicationAttributes
org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest org.grails.web.servlet.mvc.GrailsWebRequest
org.codehaus.groovy.grails.web.mapping.UrlMappingInfo grails.web.mapping.UrlMappingInfo
org.codehaus.groovy.grails.plugins.web.api.ResponseMimeTypesApi org.grails.web.mime.HttpServletResponseExtension
org.codehaus.groovy.grails.commons.GrailsApplication grails.core.GrailsApplication
org.codehaus.groovy.grails.web.mapping.DefaultUrlMappingsHolder org.grails.web.mapping.DefaultUrlMappingsHolder
org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass org.grails.core.DefaultGrailsControllerClass
org.codehaus.groovy.grails.web.mapping.DefaultUrlMappingEvaluator org.grails.web.mapping.DefaultUrlMappingEvaluator
org.codehaus.groovy.grails.commons.DefaultGrailsApplication grails.core.DefaultGrailsApplication
org.codehaus.groovy.grails.commons.ClassPropertyFetcher org.grails.core.util.ClassPropertyFetcher
org.codehaus.groovy.grails.web.util.WebUtils org.grails.web.util.WebUtils
org.codehaus.groovy.grails.commons.ControllerArtefactHandler org.grails.core.artefact.ControllerArtefactHandler

Essentially, you need to change your package imports from Grails 2 plugins to the corresponding packages in Grails 3.

For more information about how to upgrade your grails application please see Upgrading your Grails application

Comments

Unknown said…
Will like to know what GRAILS is all about

Popular posts from this blog

How to accept PayPal payments on Grails

How to enable Grails application to send SMS via Twilio API