Setting up IntelliJ environment to run old grails 2.4.2 code

48 views Asked by At

Using IntelliJ and trying the setup the environment to run "legacy" code running on Grails 2.4.2 Upgrading is not in the plans for the moment. So to do some small changes I need the recreate the environment.

I recreated the environment as close as possible by picking Groovy or Grail options. But I get a compile error stating it's unable to compile groovy code.

I made sure to have on Settings -> Build Execution, Deployment -> Compiler -> Java Compiler to run on bytecode version 7 (I'm using JDK 8 from Amazon Corretto).

Also on Project Structure-> Modules (Dependencies Tab)

  • (by default) corretto-1.8 (scope: blank)
  • grails-2.4.2 (scope: Provided)
  • Grails User Library ("project name") (scope: Compile)

On the Sources Tab I have the correct location of the source code; Confirmed in the Paths tab

I have InteliJ IDEA 2022.2.5 (Ultimate Edition)

1

There are 1 answers

0
Salvador Valencia On

I found a missing configuration piece under Tools -> Grails -> Configure Grails SDK

Once you click it you are asked to pick the project name and the location of the grails libraries (I assume that picks up the missing groovy compiler):

enter image description here

Once that was set I could run grails clean-all, grails refresh-dependencies and grails compile