问题描述:

I installed sbt using brew install sbt on Mac OS.

And the build.sbt file for my app looks like this:

import NativePackagerKeys._

packageArchetype.java_application

name := """scala-getting-started"""

version := "1.0"

scalaVersion := "2.10.4"

libraryDependencies ++= Seq(

"com.twitter" % "finagle-http_2.10" % "6.18.0",

"postgresql" % "postgresql" % "9.0-801.jdbc4"

)

What I really cannot understand is that sbt needs to get package org.scala-sbt if I want to compile the current app.

Hanfeis-MacBook-Pro:scala-getting-started hanfeisun$ sbt compile stage

Getting org.scala-sbt sbt 0.13.5 ...

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.5/jars/sbt.jar ...

[SUCCESSFUL ] org.scala-sbt#sbt;0.13.5!sbt.jar (7322ms)

Shouldn't org.scala-sbt already been installed when I install sbt by brew install sbt? Why does sbt need to download the package of itself again?

Does anyone have ideas about this? Thanks!

网友答案:

Why does sbt need to download the package of itself again?

Because you can easily change SBT version, it has to be able to download JAR files for different SBT versions. So what you actually install is just a shell script which knows how to retrieve SBT launcher if it isn't already, and how to launch it if it is.

相关阅读:
Top