Grails 3.2.0 Bootstrap.groovy script doesn't execute

我们两清 提交于 2020-06-27 17:11:18

问题


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?


回答1:


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..




回答2:


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..



来源:https://stackoverflow.com/questions/40172630/grails-3-2-0-bootstrap-groovy-script-doesnt-execute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!