如何使用构建号插件在Maven中显示SVN版本 [英] How to display SVN version in Maven usng the build-number plugin

查看:175
本文介绍了如何使用构建号插件在Maven中显示SVN版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用内部版本号插件显示svn版本和时间戳.

How do display the svn version and the timestamp using build number plugin.

目前我有以下内容

<plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <configuration>
                <format>At {0,time} on {0,date} : SVN Revision {1,number}</format>
                <items>
                    <item>timestamp</item>
                    <item>buildNumber</item>
                </items>
                <doCheck>false</doCheck>
                <doUpdate>false</doUpdate>
            </configuration>
        </plugin>
    </plugins>

显示如下:At 8:02:51 AM on Feb 2, 2011 : SVN Revision 1

但是我的svn修订版是1123.如果我注释掉<format><items>,我会得到正确的svn内部版本号.如何同时显示两者?

But my svn revision is 1123. if I comment out the <format> and <items> I get the correct svn build number. How do I display both?

谢谢

推荐答案

作为文档说,如果您使用特殊的<item> buildNumber,则它不使用SVN修订版,而是创建/读取特殊的属性文件.

As the documentation says, if you use the special <item> buildNumber, it does not use the SVN Revision, but instead creates/reads a special property file.

如果确实要使用SVN修订版,则需要遵循使用情况页面.其他示例旨在说明不使用SVN修订版,而是使用本地内部版本号(如持续集成内部版本)的用法.

If you do want to use the SVN revision, you need to follow the configuration specified in the first exmaple in the usage page. The other examples are meant to illustrate usages which does not make use of SVN revision, but a local build number (as in case of continuous integration builds).

这篇关于如何使用构建号插件在Maven中显示SVN版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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