0

I have new library I write and when I publish locally I seeing this:

org.me#new_library_2.12;0.1.0-SNAPSHOT

in local ivy.

My question is why sbt is adding 2.12 to library name?

How I can add library to other Play service without adding 2.12 in build.sbt? It look not necessary.

Mojo
  • 1,152
  • 1
  • 8
  • 16
  • 3
    Every scala library, when published _(local or to any remote repository)_ will include the scala version number in its name. The rationale is very simply, if something was compiled with *Scala* `2.12` it will only work if used in another project that uses `2.12` too. If using another version, it will probably break due binary incompatibilities. - Now, regarding how to use such library in sbt, you will do `"organization" %% "library" % "version"` _(note the double `%%`)_. That will tell sbt to add the **Scala** version you are using to the name. – Luis Miguel Mejía Suárez Apr 13 '19 at 12:31
  • 2
    Does [this](https://stackoverflow.com/questions/8288859/how-do-you-remove-the-scala-version-postfix-from-artifacts-builtpublished-wi) answer your question? Also, have you seen [this warning](https://stackoverflow.com/a/21515489/2707792)? Why do you want to remove the scala version in the first place? Is your project java-only? – Andrey Tyukin Apr 13 '19 at 12:31
  • Yes I am not messing with this number. I just wanted knowing why sbt is adding this version number. Thank you – Mojo Apr 13 '19 at 12:56
  • 2
    @Mojo Ok, then does [this](https://stackoverflow.com/questions/23122139/why-does-the-cross-building-convention-append-the-scala-version-to-the-artifacti) answer your question? In a nutshell: *"[it] is a historical decision that was made long time ago so it'll likely not going to change [...]"*. – Andrey Tyukin Apr 13 '19 at 13:18
  • @AndreyTyukin yes thank you sir – Mojo Apr 13 '19 at 14:01

0 Answers0