Skip to end of banner
Go to start of banner

Upgrading Grails 5 to Grails 6

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

Initial things (Proper writeup to follow)

  • profiles are gone, use create-plugin or create-restapi from grails CLI (Steve says create-restapi may be best for plugins, with a changed up publishing block...?)
  • Versions used
    • Grails version 6.1.1
    • Gradle version 7.6.3
    • Java version 17.0.6-tem
    • Groovy version 3.0.11

  • Move everything except gitignore and README from grails cli into a "service" directory, since this is the shape our modules are previously
  •  In build.gradle
    • Comment out "application" block
    • Comment out java sourceCompatibility block
    • Copy across
      • Group
      • Plugins/repositories
      • Configurations
      • "Custom deps" which definitely don't intefere with the bootstrapped grails 6 deps
      • Buildscript
    • NOTE - buildProperties no longer exists so for now comment out the generate descriptors blocks. Needs some input from Steve on how to proceed.
    • ./gradlew clean to check everything builds
    • Then work through dependencies in original app, cross referencing to new app's ones, and vice versa. Make changes, additions and comment out unnecessary ones
      • It is IMPORTANT to do this in both directions. There may be newer grails 6 dependencies that supercede older ones, so go through line by line in the "core" deps list and try to understand whether a dependency is missing because it's been superceded, or included because it's now no longer drawn in automatically via other deps etc etc.
      • The "custom dependencies" list can likely be pulled over verbatim though.
      • Possible exceptions
        • move spring-security core into the "proper" dependencies block and bump version up to grails version (6.1.1... can use implementation("org.grails.plugins:spring-security-core:${grailsVersion}")). Was in place to handle security issues present in grails 5
        • make sure web-toolkit and grails okapi are on grails6 versions (TBD on release)
    • MAKE SURE you copy across the profile declaration. This is no longer supplied by the CLI, so we need to make sure its there.
    • On that note, delete the grails cli yaml file (question)
    • Copy over bootJar.enabled stuff and eclipse block
    • May need to remove anything referencing configScript, as this appears to have been removed
    • AT THIS STAGE, it may be beneficial to copy across the .git dir, and to set up a branch for your changes
    • Copy over grails-app directories one by one, and also src folder and anything else that has been removed
  • For apps gradle.properties
    • Copy across everything but the grailsVersion and grailsGradlePluginVersion from existing repo (ENSURE that groovy version lines up though)
  • No labels