如何将SVN修订号注入JAR? [英] How to inject SVN revision number into JAR?

查看:184
本文介绍了如何将SVN修订号注入JAR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的JAR / WAR应用程序知道它的源代码的SVN版本号是什么。我希望稍后为网页底部的Web最终用户呈现此修订版号等。

I want my JAR/WAR application to know what is the SVN revision number of its source code. I want this revision number to be later rendered for web end-users at the bottom of a web page, etc.

是否有任何现有的Maven插件可自动执行此过程?我认为该插件必须从 svn 中收集信息并保存到某个文件,例如 src / resources / revision.txt

Is there any existing Maven plugin to automate the process? I think that the plugin has to collect the information from svn and save to some file, like src/resources/revision.txt.

推荐答案

此页面提供了几乎相同问题的答案:

This page provides the answer to an almost identical problem:

Maven CookBook:如何将SVN修订添加到JAR清单?

Maven CookBook: How To Add SVN Revision To A JAR Manifest?

在您的情况下,您需要使用buildNumber变量而不是构建清单条目for 资源过滤

In your case, instead of building a manifest entry, you need to use the buildNumber variable for resource filtering

这篇关于如何将SVN修订号注入JAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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