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

查看:18
本文介绍了在应用程序中嵌入来自 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?

推荐答案

如果您使用 lein run 或类似工具在 Leiningen 内运行,它可作为系统属性使用:(System/getProperty "myproject.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天全站免登陆