Plugin.sbt: Include Github-Url to get latest version of plugin?


(Marc) #1

Hi,

is it possible to include a github url in plugin.sbt to get the latest version?

eg:

replace

addSbtPlugin(“com.typesafe.play” % “sbt-plugin” % “2.7.0-M4”)

with something like

addSbtPlugin(“com.typesafe.play” % “sbt-plugin” % “https://github-url”)

to get latest?

I found one solution oj Stackoverflow, but I get an error trying it that way.

thanks
marc


(Marcos Pereira) #2

This is more like an sbt question, and I’m not sure it is even possible.

What you can do, maybe, is to read https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/play/play_2.12/maven-metadata.xml and set the plugin version to the latest value there.

We publish snapshots regularly (needs a small adjustment now), so you will end up no more than a 1-2 days late. Of course, you need to add a resolver to https://oss.sonatype.org/content/repositories/snapshots.

Best.


(Alexey Alekhin) #3

The solution from SO is the way to go. Which error do you get if you try it and how exactly do you apply this solution to your case?


(Marc) #4

hi marco,

thanks for this, bit it seems the latest snapshot of 2.7 is from october?

the last entry is:
2.7.0-2018-10-24-c19a9bd-SNAPSHOT

thanks!
marc


(Marc) #5

Hi laughedelic,

the error I get is:

“Type mismatch, expected: ClasspathDep[ProjectReference], actual: sbt.URI”

located here:

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

any idea?

thanks
marc


(Alexey Alekhin) #6

The code in that answer is for sbt 0.13, in sbt 1 you have to use RootProject(uri(...)). See the docs:

lazy val root = (project in file(".")).dependsOn(assemblyPlugin)
lazy val assemblyPlugin = RootProject(uri("git://github.com/sbt/sbt-assembly"))