Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


emulates Maven's uniqueVersion snapshots

Subscribe to updates I use sbt-unique-version

Statistics on sbt-unique-version

Number of watchers on Github 24
Number of open issues 2
Average time to close an issue 21 days
Main language Scala
Average time to merge a PR 3 days
Open pull requests 0+
Closed pull requests 0+
Last commit about 6 years ago
Repo Created about 8 years ago
Repo Last Updated about 3 years ago
Size 190 KB
Organization / Authorsbt
Page Updated
Do you use sbt-unique-version? Leave a review!
View open issues (2)
View sbt-unique-version activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating sbt-unique-version for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


sbt-unique-version emulates Maven's uniqueVersion snapshots on Ivy repos.


Try using git SHA. Josh Suereth in Effective sbt at Scala Days 2013 came up with an alternative approach. This could be the approach after sbt 0.13 and up.

val gitHeadCommitSha = settingKey[String]("current git commit SHA")

gitHeadCommitSha in ThisBuild := Process("git rev-parse HEAD").lines.head

version in ThisBuild := "1.0-" + gitHeadCommitSha.value


resolvers += Resolver.url("sbt-plugin-releases", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("sbt-plugin-snapshots", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.eed3si9n" % "sbt-unique-version" % "latest.integration") // or "0.1.0"


Add the following in your build.sbt:

import UniqueVersionKeys._ // put this at the top


uniqueVersion := true

Set the version to a snapshot one such as "0.1.0-SNAPSHOT". This would substitute the artifact revision to something like "0.1.0-20120602-065305".

Optionally you can also specify the IvyStatus as follows:

ivyStatus <<= (version) { (v) =>
  if (v endsWith "-SNAPSHOT") IvyStatus.Integration
  else IvyStatus.Release

How to point at it

  • "0.1.0" or "0.1.0-20120602-073010" you can always use the static version number.
  • "0.1.0-+" selects the latest 0.1.0 snapshot.
  • "latest.integration" selects the latest revision regardless of its status.
  • "latest.milestone" selects the latest revision with either Milestone or Release status.
  • "latest.release" selects the latest with the Release status.

For example,

addSbtPlugin("com.eed3si9n" % "sbt-unique-version" % "0.1.0-+")

This adds the latest 0.1.0 snapshot of sbt-unique-version to your build.

What's the point of this?

The current way sbt does the snapshots is to overwrite the jar file with the same resolution URL. That is a cause of several issues like caching issues and security settings at the repository.


Unlike Maven's uniqueVersion, or just plain x.x.x-SNAPSHOT, this approach takes over the revision.

sbt-unique-version open issues Ask a question     (View All Issues)
  • over 5 years Does not work with sbt 0.13.8
  • over 5 years Support Scala 2.11
sbt-unique-version list of languages used
Other projects in Scala