Search code examples
scalapluginsbuildpublishsbt-native-packager

how to stop sbt package command from appending hash to the name of the jar


I cloned https://github.com/sbt/sbt-native-packager and then from sbt console ran "package"

and it generated sbt-native-packager/target/scala-2.9.2/sbt-0.12/sbt-native-packager-0.6.3-dd499ad2b6d0cc108e89827196a32cc6c7a880b0.jar

How do I stop it from generating the hash/sha? or How do I publish it without the hash?


Solution

  • The native packager is using the sbt-git plugin by default. It adds the hash so you can release integration builds.

    You have two options here:

    1. In the sbt console, run set version := "My-version" and it will disable the default behavior.
    2. Create a tag with the following structure: v<version> and it will use that instead.

    You can read more about git versioning on the sbt-git page: https://github.com/sbt/sbt-git#versioning-with-git