clojureleiningen

Embed version string from leiningen project in application


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, or as a header in a ring application. Is this possible?


Solution

  • If you're running inside Leiningen using lein run or the like, it's available as a system property: (System/getProperty "myproject.version"). If you're producing a jar you need to read pom.properties.