grails -Dserver.port=80 -Duse.root.context.path=true run-appbut first, you have to modify _GrailsRun.groovy and change an existing method to this:
private runInline(scheme, host, httpPort, httpsPort) { EmbeddableServerFactory serverFactory = loadServerFactory() def useRootContextPath = System.getProperty("use.root.context.path") if(useRootContextPath) serverContextPath = '/' grailsServer = serverFactory.createInline("${basedir}/web-app", webXmlFile.absolutePath, serverContextPath, classLoader) runServer server: grailsServer, host:host, httpPort: httpPort, httpsPort: httpsPort, scheme:scheme startPluginScanner() }You can find _GrailsRun.groovy in $GRAILS_HOME/scripts
WARNING: THERE ARE SERIOUS PENALTIES FOR ROLLING OUT YOUR APP THIS WAY
The code seems trivial but I'll submit it anyway to the grails dev team for inclusion. Did it work for you? You are welcome to post your comments/questions or better yet, link to this post, blog about it and tell all your friends who might find this post useful.
There's no need to edit any scripts - this is a maintenance problem since you'll need to keep editing scripts each time you upgrade. Just put
ReplyDeleteapp.context=/
in your application.properties