playframework prod, qa, dev variables in app.conf

2019-07-19 23:04发布

We use "play.bat run" for production and "play.bat run --%dev" for development(and another for QA) but when we change the launch configuration so --%dev is in the arguments, it doesn't work and loads the production variables instead. How does one launch the debugger so it is running with our development settings?

thanks, Dean

3条回答
The star\"
2楼-- · 2019-07-19 23:09

When running your Play instance inside Eclipse, you can modify the launch configuration, in the Run menu, select "Run configurations..."

On the left are all your configurations, where you will find one named as you Play project (if you ran play eclipsify). You can select it, go into the "Arguments" tab and look for "-Dplay.id=" in the VM arguments. You can modifiy the play id used here. (ie "-Dplay.id=dev")

You can also duplicate your eclipse run configurations by right clicking on the left tree, therefore you can have one run configuration per play id.

查看更多
【Aperson】
3楼-- · 2019-07-19 23:12

The eclipse launcher and the eclipse debug launcher, which gets generated by the

play eclipsify

command need not be modified to pass --%dev parameter.

Start play from the command line -

play run --%dev

You should the below line in the command window -

Listening for transport dt_socket at address: 8000

Verify the port is 8000, if it is different, then you need to modify the eclipse debug launcher to this port. By default the files generated have 8000 port

查看更多
狗以群分
4楼-- · 2019-07-19 23:20

Starting with the --%dev command will use all the properties defined with the %dev prefix in your application.conf. If a property is not defined with %dev then the default one (one without prefix) is used. You need to differentiate between your environment settings and play running mode.

For example:

application.mode=prod
%dev.application.mode=dev

will start play in prod mode when used without framework id. if --%dev is used then play will start in dev mode (request are serialized, application waits for the first request to start, ...)

查看更多
登录 后发表回答