如何让sbt从git repo编译插件,使用https检查出来?

Rob*_*een 5 git github sbt

根据sbt wiki的一个例子,我尝试了一个projects/projects/Build.scala包含:

import sbt._

object PluginDef extends Build {
    override lazy val projects = Seq(root)
    lazy val root = Project("plugins", file(".")) dependsOn( eclipsePlugin )
    lazy val eclipsePlugin = uri("git://github.com/typesafehub/sbteclipse.git")
}
Run Code Online (Sandbox Code Playgroud)

但是,正如预期的那样失败,因为git端口在工作时被阻止.

和:

import sbt._

object PluginDef extends Build {
    override lazy val projects = Seq(root)
    lazy val root = Project("plugins", file(".")) dependsOn( eclipsePlugin )
    lazy val eclipsePlugin = uri("https://github.com/typesafehub/sbteclipse.git")
}
Run Code Online (Sandbox Code Playgroud)

但这给了一个FileNotFoundException(我猜它不被认为是一个git URL).

Rob*_*een 0

本地查看一下,uri("...")改成file("/path/to/git/working/directory").

不太自动化,但它可以让您控制何时更新插件。