sbt/sbt-dynver

What is the best way to prepend a dependency version number in front of the version ?

leobenkel opened this issue · 4 comments

I would like to produce something similar to https://mvnrepository.com/artifact/com.holdenkarau/spark-testing-base
where the version is s"$sparkVersion_$v".

I tried:

version in ThisBuild ~= (v => s"${sparkVersionSystem}_$v"),
dynver in ThisBuild ~= (v => s"${sparkVersionSystem}_$v")

but the result is

2.4.5_2.4.5_2.4.5_2.4.5_2.4.5_2.4.5_0.10.0+0-a66caf82+20200824-1537-SNAPSHOT

so it seems that something got wrong haha.

for some reason after rerunning it, it seems to be working now. so weird.

oh it worked after i removed the in ThisBuild

You can try dynverTagPrefix in ThisBuild := "foo-" too (see the README).

Beware that doing version ~= ... will define the setting in the "current" project, which can mean the "root" project, for example. So version in ThisBuild will still mean what it means out the box, and other projects will continue to use that value.

nafg commented

Isn't it better to put such info in the artifact name?