在应用程序中嵌入leiningen项目中的版本字符串 [英] Embed version string from leiningen project in application

查看:132
本文介绍了在应用程序中嵌入leiningen项目中的版本字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要能够查询或嵌入由leiningen项目设置的版本字符串,并将该值显示给用户。用途包括显示来自CLI的版本字符串,或作为环应用程序中的标头。这是可能的吗?

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?

推荐答案

如果你在Leiningen里面使用 lein run 等,它可以作为系统属性:(System / getPropertymyproject.version)。如果你生成一个jar,你需要阅读 pom.properties

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.

这篇关于在应用程序中嵌入leiningen项目中的版本字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆