我不认为你可以设置当前的Grails build pack上下文路径。如果你觉得这样,你可以分解构建包并破解它以支持设置上下文(有关构建包的更多信息,请参阅build pack doc)。
另一种选择是将您的Grails应用程序本地构建到WAR文件中并使用WAR deployment部署WAR文件。 WAR部署过程将使用webapp-runner实用程序在Tomcat上运行您的应用程序,并支持配置上下文路径。下面是帮助输出为webapp的亚军7.0.22.3(我碰巧已经安装,可能会稍显落伍):
Tomcat Runner runs a Java web application that is represented as an exploded war in a Tomcat container Usage: java -jar tomcat-runner.jar [arguments...] path/to/webapp Arguments: --session-timeout The number of minutes of inactivity before a user's session is timed out
--port The port that the server will accept http requests on
--context_xml The parth to the context xml to use
--path context path (default is /)
--session_manager session store to use (valid options are 'memcache')
--session_manager_operation_timeoutoperation timeout for the memcached session manager. (default is 5000ms)
--session_manager_locking_modeSession locking mode for use with memcache session store. (default is all)
--session_manager_ignore_patternRequest pattern to not track sessions for. Valid only with memcache session store. (default is '.*\.(png|gif|jpg|css|js)$'
如WAR deploy doc解释,你可以为Web应用程序,亚军选项你的webapp使用WEBAPP_RUNNER_OPTS
config var。
不幸的是,这似乎并不像Heroku上写的那样工作。我创建了'/ web-app/WEB-INF/jetty-web.xml'并粘贴上面,在产品中获得了一个404命中'/ xyz'。我想知道如果Heroku在启动应用程序时看到并使用了'jetty-web.xml'文件。 – 2012-07-29 16:11:09