Play Framework 2开发配置 [英] Play framework 2 development configuration

查看:82
本文介绍了Play Framework 2开发配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Play 2应用程序中为开发和生产模式设置不同的配置?

How I can setup different configuration for development and production mode in Play 2 application?

我试图像这样在开发模式下的应用程序启动时使用JVM参数:

I've try to use JVM arguments on application start in development mode like this:

play "run -Dconfig.resource=dev.conf"

或通过Play控制台:

or from Play console:

run -Dconfig.resource=dev.conf

但是没有用.

推荐答案

应该有效:

play -Dconfig.resource=dev.conf "run"

无论如何,我在-Dconfig.resource上遇到了一些问题,所以我改用-Dconfig.file

Anyway I had some problems with -Dconfig.resource so I'm using -Dconfig.file instead

play -Dconfig.file=/full/path/to/your/project_folder/conf/alt_conf.conf "run"

这篇关于Play Framework 2开发配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆