Fork me on GitHub
#leiningen
<
2022-02-13
>
wombawomba12:02:57

I'd like to inject a version including build number when building an uberjar — preferably as a Java property (so that (System/getProperty "my-version-prop") in the built uberjar will return a value that I specified when building). Is there a way to do this?

Alex Miller (Clojure team)13:02:54

There is no way to “set” a Java system property - that's a property st runtime. The only way to do this would be to run code from the uber main that did System/setProperty. Another option would be to generate a resource included in the uberjar and then read the resource (that's how something like *clojure-version* works)

mikerod15:02:59

Not sure if https://github.com/trptcolin/versioneer would be helpful to you here either.