We are using a non-standard version number system for our software, which is causing problems with sbt
finding the wrong version.
Jars in a branch with name feature/x-y-z
will be published with the version x-y-SNAPSHOT
to a Maven repo.
Released jars include the version of a data definition jar, since code compiled against different versions of the base data classes frequently fails in confusing ways, so the released jar will typically have a version like 1.2.3-1
, where this is the first release using the 1.2.3
data classes.
My sbt has (in part)
val LibVersion = "x-y-SNAPSHOT"
lazy val root = project.in(file(".")).settings(
libraryDependences ++= Seq(
"com.example" % "some-lib" % LibVersion,
"com.example" %% "some-scala-lib" % "4.3.0"
)
If I run show externalDependencyClasspath
, it lists some-lib-x-y-<datetime info>.jar
(which is correct). If I run dependencyTree
, it lists something like some-lib-1.2.3-6
(which is wrong).
The code is eventually built into a Docker image (I think via sbt stage
and some other tooling) with the wrong (1.2.3-6
) version of some-lib
.
I have also included a
dependencyOverrides ++= Seq(
"com.example" % "some-lib" % LibVersion) // with or without force() here
with no apparent effect.
Is there some way to get sbt
to use the version I am telling it to use?
I am running sbt 1.9.1
and these plugins from project/plugins.sbt
:
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.5")