问题
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