2

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

Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • Could you tell what prod variables are getting picked? What debugger are you referring here? – basav Feb 07 '12 at 13:59
  • yes, the default variables get picked. I am using eclipse according to their documents then modify the launch config they provided to feed in --%dev and it doesn't work the same as "play.bat run --%dev" which is what is expected. – Dean Hiller Feb 09 '12 at 03:14

3 Answers3

3

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, ...)

Pere Villega
  • 16,429
  • 5
  • 63
  • 100
emt14
  • 4,846
  • 7
  • 37
  • 58
  • Eclipse will start with the default configuration. If you need to specify the env you need to edit the run configuration. – emt14 Feb 11 '12 at 05:39
3

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

basav
  • 1,453
  • 10
  • 18
1

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.

Louis Carrese
  • 791
  • 4
  • 7