假设我们需要向一些工件(jar,war等)添加内部版本号。 在这里,我想演示
buildnumber-maven-plugin的用法。
这篇文章基于:
- http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html
- http://www.site.lalitbhatt.com/maven-build-number-plugin
- http://blog.peterlynch.ca/2009/11/buildnumber-maven-plugin-helpful.html
- http://apollo.ucalgary.ca/tlcprojectswiki/index.php/Public/Project_Versioning_-_Best_Practices#Build_Versioning
我们有一些项目,需要在jar清单文件中包含不基于VCS(SVN,Git,Mercurial等)修订版本的顺序内部版本号。 让我们创建适当的pom.xml文件,并实施一个小型演示以验证结果。
生成Maven项目
$ mvn archetype:generate -DgroupId=org.halyph -DartifactId=buildNoTest\
-DarchetypeArtifactId=maven-archetype-quickstart \
-DinteractiveMode=false
创建pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=