Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 587
Hanfei Sun Avatar asked Mar 08 '15 09:03

Hanfei Sun


1 Answers

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.

like image 139
l p Avatar answered Oct 06 '22 02:10

l p