Fork me on GitHub

I tried to read the Leiningen documentation regarding profiles but I'm still a bit puzzled. If I build a jar with command lein with-profile +myprofile ring uberjar ... and then run the jar with command: java -jar target/uberjar/myserver-1.0-standalone.jar ... everything works just fine - application finds the environmental variables defined in file profiles.clj / :myprofile section. But if I move the jar file from the project/target directory somewhere else (e.g. /tmp) and try to start the application in that directory: java -jar myserver-1.0-standalone.jar => the application doesn't find the environmental variables. I somehow assumed that when you build the uberjar with a specific profile, then that profile will be available. What did I miss? My Leiningen version: Leiningen 2.8.3 on Java 11.0.1 OpenJDK 64-Bit Server VM


Ok. I think I got it. There is this .lein-env file that apparently gets generated when building the jar.