0

I am running Play 2.4 inside a machine provisioned by Vagrant. I have the project files mounted to the VM config.vm.synced_folder "project_src/", "/home/vagrant/project_src/"

My play config has the the port setting to play.server.http.port=8888 but this setting is not being picked up. Even when I start play with the conf option run -Dconf.resource=application.conf or any other conf file the setting is not being picked up.

The perm on the file is -rw-r--r-- 1 vagrant vagrant application.conf so I'm pretty sure that is not the issue either.

The only way I can set the port is with -Dhttp.port=8888 which is fine but there are other env settings I'd like to read from the conf file.

Any suggestions?

Adgezaza
  • 1,295
  • 3
  • 12
  • 32
  • According to this setting the port in `application.conf` is Play 1.x only: http://stackoverflow.com/questions/8205067/how-do-i-change-the-default-port-9000-that-play-uses-when-i-execute-the-run – Brandon Hill Nov 18 '15 at 19:33
  • It still works on 2.4 and you can also set it in the conf https://www.playframework.com/documentation/2.4.x/ProductionConfiguration#Server-configuration-options – Adgezaza Nov 18 '15 at 19:39
  • @Adgezaza I have to agree with brandonhill. In production mode it's not possible to set the port via application.conf. But you can set it via `-Dhttp.port=1234`. See https://www.playframework.com/documentation/2.4.x/ProductionConfiguration for more information. – Kris Nov 18 '15 at 20:36
  • @Kris how do I read it in a non prod env? `~run`? That isn't reading the conf either. Is it also only the port conf? – Adgezaza Nov 18 '15 at 20:49
  • Yes, use `activator -Dhttp.port=1234 run`. – Kris Nov 18 '15 at 20:54

0 Answers0