Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct procedure for upgrading a Grails project from version a.b.c to x.y.z

I have been developing Grails apps for the past five years or so, and I have yet to find a simple consistent procedure for upgrading a project between Grails versions. Typically, I wind up starting the project from scratch, painstakingly copying code from the old project into a new project, bit by bit. Tweaking along the way to get the tests to pass.

There just seems to be too many balls to juggle, from Grails versions, to groovy versions, to STS/GGTS versions. They all seem to be backwardly incompatible.

like image 650
spierepf Avatar asked Mar 18 '23 23:03

spierepf


2 Answers

I actually work with Grails for a few years too and never had to that this way.

What I do is:

  1. Install the new version of Grails. I use GVM for that and I highly recommend it, but it depends on your platform of choice.
  2. Read release notes for this version and apply them. It's very important step. It often includes some Grails "built-in" plugins upgrades and so on.
  3. Bump up the version number using grails set-version.
  4. Update IDE settings. I use IntelliJ and it runs smoothly most of the time.
  5. Do grails clean/grails clean-all. Remove target.
  6. Run all tests.
  7. Do some "smoke tests" of the application. Test the most important happy paths.
like image 99
Marcin Świerczyński Avatar answered Mar 20 '23 12:03

Marcin Świerczyński


I'm afraid you might already be doing it right, but if you don't own a copy of "Programming Grails" by Burt Beckwith I suggest you buy it. There's a chapter on "Upgrading Applications and Plugins" that might help you tune your approach.

like image 42
wwwclaes Avatar answered Mar 20 '23 12:03

wwwclaes