I think you're better off running your jar with the java parameter
java -jar ... -Dhttp.port=1234
Or alternatively (and my preferred approach), use different configuration files per environment.
So, in development mode you run:
sbt -Dconfig.resource=application.dev.conf run
And in the file conf/application.dev.conf
have all the configuration you want for the development mode. Then in the conf/application.conf
you can have the production configuration.
Remember that you can compose those files. So, write them like this:
conf/application.conf
# the assembly command will take this one.
http.port=9000
conf/application.dev.conf
include "application.conf"
#override configuration parameters here for dev mode.
http.port=1234
This way, when you do the assembly, you don't need to worry about it, since it takes by default the conf/application.conf
file, the other one will be ignored unless you launch the jar with the parameter of course.
java -jar -Dconfig.resource=application.dev.conf
Or finally override anything with the java parameter
java -jar -Dconfig.resource=application.dev.conf -Dhttp.port=4321
This last one, will launch the app with the dev mode configuration and also overrides the port.