sbtscalatra

Scalatra - change port for standalone server


I am developing a Scalatra application and require the port to be different than the default port 8080. I added the following to the end of my build.sbt:

containerPort in Jetty := 8089

This works great when I am starting the Jetty server within the sbt console (i.e. using jetty:start) but it doesn't work when I create a standalone .jar file using sbt-assembly. When I run the .jar, it still starts the server on port 8080.

Is there something additionally that I need to add to my build.sbt or elsewhere to ensure that sbt-assembly will properly recognize my desired port number?

Thanks in advance!


Solution

  • I solved this by editing the default port in the Bootstrap file. Wasn't able to find a way to do it with changes in the build.sbt file.