In SBT, how to use addSbtPlugin with a Github URL?

Currently, I used a plugin like this:

addSbtPlugin("com.tuplejump" % "sbt-yeoman" % "0.7.1")

But then, I fork this plugin on github (let's say https://github.com/myname/play-yeoman.git ) and make some changes, what would be an easier way to use my forked version of plugin? Do I really have to register this fork on a maven/ivy repository?

Thanks!


Using SBT 0.13.8, I was able to replace the following line in my ./project/plugins.sbt:

addSbtPlugin("net.ground5hark.sbt" %% "sbt-concat" % "0.1.8")

with the following two lines

lazy val root = (project in file(".")).dependsOn(concatPlugin)

lazy val concatPlugin = uri("https://github.com/ground5hark/sbt-concat.git#342acc34195438799b8a278fda94b126238aae17")

No other steps were necessary. Also, note that the git URI has a commit hash on the end. This is very useful for ensuring a known-to-work, specific version of the source is used in the project, rather than whatever the latest unknown state of the source is.


Follow this steps:

  • Add -SNAPSHOT suffix to the version of the plugin, ie version := "1.0.0-SNAPSHOT"
  • Run sbt publishLocal from the command line.
  • Reference the snapshot version from your plugins.sbt .
  • 链接地址: http://www.djcxy.com/p/25152.html

    上一篇: 如何构建从data.table到magrittr并返回到data.table的管道

    下一篇: 在SBT中,如何将addSbtPlugin与Github URL一起使用?