# How to version a library between Scala 2 and Scala 3

**URL:** <https://users.scala-lang.org/t/how-to-version-a-library-between-scala-2-and-scala-3/9440>\
**Category:** Libraries\
**Created:** [July 28, 2023, 2:11pm UTC](https://users.scala-lang.org/t/how-to-version-a-library-between-scala-2-and-scala-3/9440 "2023-07-28T14:11:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Turin](https://users.scala-lang.org/user_avatar/users.scala-lang.org/turin/32/2092_2.png) [@Turin](https://users.scala-lang.org/u/Turin)\
**Post date:** [July 28, 2023, 2:11pm UTC](https://users.scala-lang.org/t/how-to-version-a-library-between-scala-2-and-scala-3/9440/1 "2023-07-28T14:11:56Z")

</div>

I am aware that Scala libraries typically have in their name the Scala version with which they are binary compatible, but it is for that: maintaining binary compatibility, and the the same maven version largely implies source compatibility (at least for the most part).

However, differences between Scala 2 and Scala 3 are quite drastic, especially if you deal with type-level programming and syntax enrichment. This requires a rewrite of a considerable part of library code, and maintaining the same maven version between goes against the policy of least surprise.  
However, when maintaining both a version of Scala 2 and Scala 3, it is typical that the general functionality remains roughly the same, only the means of accomplishing them differ. Therefore, it would be nice if it would be somehow possible to link such ‘logical’ versions with each other.  
It would be confusing for me if a version `2.3` (for example) for Scala 3 was largely independent and unrelated to a Scala 2 version in terms of being up to date with functionality.

Is there a pattern, or best practice established to deal with this issue?  
Or should I simply repeat the major scala version in the maven version, for example:

```auto
turin-squirrel_2.13-s2_1.1.jar
turin-squirrel_3.3-s3_1.1.jar

```

Would love to see what approaches are taken by others in similar cases.

---

<div class="post-metadata">

**Author:** ![bishabosha](https://users.scala-lang.org/user_avatar/users.scala-lang.org/bishabosha/32/2567_2.png) [@bishabosha](https://users.scala-lang.org/u/bishabosha)\
**Post date:** [July 28, 2023, 5:37pm UTC](https://users.scala-lang.org/t/how-to-version-a-library-between-scala-2-and-scala-3/9440/2 "2023-07-28T17:37:55Z")

</div>

[Scodec’s](https://index.scala-lang.org/scodec/scodec) 2.12/2.13 implementation uses the 1.x.y version, and its Scala 3 implementation uses the 2.w.z version. The artefact name is the same though.

However [shapeless-3](https://index.scala-lang.org/typelevel/shapeless-3) uses another artefact name and is exclusive to scala 3
