Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails shell doesn't recompile changed files

I'm new to grails and came across an issue of grails shell not recompiling my classes even though displaying a message about it. Here is what I'm doing:

  1. I have a grails 2.0.0 app that has class with certain static methods
  2. I would like to test some of the functionality from grails shell, so I go ahead and launch it from the grails project folder as grails shell
  3. I'm calling a static method of the class to perform some work as follows:

    import com.mypackage.*
    MyClass.doWork()
    
  4. If I'm seeing some unexpected behavior or runtime error I'm modifying the source code accordingly and grails shell shows it actually is seeing the change: |Compiling 2 source files.

  5. Then I run the method, but it's seems that the method is the same, because it gives me same error even though I'm sure I've saved the groovy file.
  6. So, I have to exit the shell and launch it again. Then grails picks up the changes.

What I'm doing wrong? It seems to be rather weird expected behavior...

like image 928
Tomato Avatar asked Mar 05 '12 21:03

Tomato


1 Answers

Only run-app enables reloading by default. Run grails -reloading shell to reload changed files. I'd use the console though - it's way more user-friendly: grails -reloading console.

like image 134
Burt Beckwith Avatar answered Sep 28 '22 09:09

Burt Beckwith