Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch sbt run with a specific port number

Tags:

sbt

I would like to launch sbt with a specific port number directly :

 sbt run 9001

does not work as 9001 is ignored.

What works however is to first launch sbt and then use the command run 9001

How could I combine both directly in one command line I could run in my shell ?

like image 281
Scipion Avatar asked May 20 '16 11:05

Scipion


People also ask

Is it possible to specify port number after run SBT?

With the commit introduced today (Nov 25), you can now specify a port number right after the run or start sbt commands. Show activity on this post. On Windows maybe the play "run 9001" will not work. You have to change the play.bat file. See Ticket Show activity on this post.

When SBT server will be running?

By default, sbt server will be running when a sbt shell session is active. When the server is up, it will create a file called the port file. The port file is located at ./project/target/active.json.

How do I run SBT from the command line?

When you’re running the SBT run command from your operating system command line, enclose the run command and the command-line parameters in quotes, like this: $ sbt "run foo bar baz". This process also works when there are multiple main methods in your project: $ sbt "run foo bar baz" [warn] Executing in batch mode.

What is the SBT Launcher Component?

The sbt launcher component is a self-contained jar that boots a Scala application or server without Scala or the application already existing on the system. The only prerequisites are the launcher jar itself, an optional configuration file, and a Java runtime version 1.6 or greater. A user downloads the launcher jar and creates a script to run it.


2 Answers

If I remember well, I think you have to add all the parameters between quotes. In you case:

sbt "run 9001"
like image 109
Carlos Vilchez Avatar answered Sep 25 '22 02:09

Carlos Vilchez


When you run sbt console it's enough to use run 9001 without any quotation marks.

like image 23
Patryk Rudnicki Avatar answered Sep 23 '22 02:09

Patryk Rudnicki