3

After i updated my project from Grails 3.1.11 to 3.2.0 the project has stopped working.

When i start proj from IDE, it works fine. But when i pack it to jar and try to run in terminal, BootStrap.groovy does not execute.

What is the problem?

Sergey Linnik
  • 397
  • 4
  • 14
  • 1
    Is your BootStrap.groovy in a specific package or is it just in the default one e.g. no package defined in the file? – Gregor Petrin Oct 21 '16 at 11:20
  • @GregorPetrin in default, no package – Sergey Linnik Oct 21 '16 at 11:22
  • Nevermind, I just tested and it executes regardless, we've been having issues with e.g. taglibs that have no package defined; is your BootStrap in `grails-app/init/BootStrap.groovy` or somewhere else? – Gregor Petrin Oct 21 '16 at 11:24
  • @GregorPetrin my BootStrap.groovy is in grails-app/init. I already found an issue on GitHub about this problem and answered bellow. Thank you for help! – Sergey Linnik Oct 21 '16 at 11:39

2 Answers2

4

I just found an issue on GitHub. Now BootStrap.groovy and UrlMappings.groovy should be in the default package

Default package is indicated in application.yml

grails:
    codegen:
        defaultPackage: com.example.app

Migration docs has no information about this issue yet..

IgniteCoders
  • 4,834
  • 3
  • 44
  • 62
Sergey Linnik
  • 397
  • 4
  • 14
0

sergey Linnik's answer is correct the Bootstrap.groovy file should be in a default package, but lookout when using a IDE (in my case Intellij 2016.2.4) for refactoring the Bootstrap.groovy class from the init folder to a default package that it adds

package default //ensure the package folder is added

class BootStrap {///}

Otherwise when building the grails application it moves the Bootstrap.groovy file out of the default package again because the refactoring didn't update it. Not sure if it's an intellij bug or not..

keano
  • 691
  • 7
  • 9
  • I think the issue here is that it doesn't matter where the .groovy file lives, the .class file will be placed wherever the package declaration says to put it, so when imports of the class occur, they need to look for it where the package declaration says it should be. – billjamesdev Jan 22 '18 at 22:06