I want to be able to query or embed the version string set by the leiningen project and display that value to user. Uses include displaying the version string from the CLI,
Someone has written a nice library for handling this: https://github.com/trptcolin/versioneer
It works for lein projects, both running in lein and from an uberjar. Use it like the following (taken from the Github page):
Add this to your project.clj:
[trptcolin/versioneer "0.2.0"]Then, in your code, do something like this, where GROUP-ID and ARTIFACT-ID are the usual Leiningen/Maven identifiers for your project.
user=> (require '[trptcolin.versioneer.core :as version]) nil user=> (version/get-version "GROUP-ID" "ARTIFACT-ID") "1.2.3-SNAPSHOT"