maven构建带版本号和日期的war包名

21166312

maven构建打包设置包名

svn环境设置

引用buildnumber插件

       <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
            <execution>
                <phase>validate</phase>
                <goals>
                    <goal>create</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <doCheck>false</doCheck>
            <doUpdate>false</doUpdate>
            <buildNumberPropertiesFileLocation>${project.build.directory}</buildNumberPropertiesFileLocation>
            <buildNumberPropertyName>verNum</buildNumberPropertyName>
            <timestampFormat>{0,date,yyyyMMddHHmmss}</timestampFormat>
              <items>
                <item>timestamp</item>
              </items>
        </configuration>
    </plugin>
[官网示例](http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html)

设置包名

    <build>
        <finalName>${project.artifactId}-${project.version}.v${verNum}-${timestamp}</finalName>
        ...
    <build>

结束

另一款类似插件 http://maven-svn-revision-number-plugin.googlecode.com/svn/site/usage.html

 

posted @ 2014-02-28 15:08  九州浪子  阅读(1447)  评论(0编辑  收藏  举报