Grails app only use maven to run, drop support for grails

萝らか妹 提交于 2020-01-16 19:01:06

问题


I have a grails application with maven enabled. Application is running fine using both:

grails run-app 

and

mvn grails:run-app

Now my requirement is to run application using maven only and if application is executed using grails run-app a message is displayed to run the application using maven.


回答1:


Please have a look at Grails Disable run-app command. I was also facing the same issue.

Thanks




回答2:


I don't know if it's possible in grails, but you can work it around by setting a system property using maven and then in BootStrap check if this property is set (System.getProperty('NAME')) - if not, it means that app was not run by maven and you can display a message and throw Exception in order to stop grails



来源:https://stackoverflow.com/questions/16774820/grails-app-only-use-maven-to-run-drop-support-for-grails

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