Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Scala sbt update every time I start it from command prompt?

Tags:

scala

sbt

I am a beginner in Scala and every time I start sbt from command prompt it goes into a long update and it takes several minutes for the sbt to update. I read in the instructions that the sbt was going to update the first time it was started from the command prompt but in my case it is updating every time I start it. I have to wait several minutes for it to update and it takes away some of the joy of learning Scala. So my question is how do I stop sbt from updating every time and is it normal for it to do so?

edit:

This is how my sbt command looks and after this it goes into a long update.

enter image description here

edit2:

enter image description here

like image 366
zindarod Avatar asked Aug 11 '13 17:08

zindarod


1 Answers

SBT is designed to be started once when you start working on the project and not shut down. This saves you the time it takes for the JVM to start as well as any start up tasks that SBT dose at start up.

So instead of running:

sbt test

at your operating systems shell prompt you can run

sbt

With no arguments which will drop you into the sbt prompt.

From hear you can run sbt commands (the same as you normally do but without the sbt prefix because your already in sbt (eg compile, test ....) one after the other with no start up time which is much quicker.

Another big time saver is that in the sbt prompt you can put a ~ at the start of many sbt commands to have them run automatically. eg

~test

Will start running your tests as soon as you save in your IDE/editor.

like image 129
Mark Avatar answered Sep 28 '22 09:09

Mark