通过buildnumber-maven-plugin把svn版本号打入jar或war包中

<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>buildnumber-maven-plugin</artifactId>
   <version>1.0</verson>
    <executions>
	<execution>
		<phase>validate</phase>
		<goals>
			<goal>create</goal>
		</goals>
	<execution>
    </executions>
    <configuration>
	<doCheck>true</doCheck>
	<doUpdate>true</doUpdate>
    </configuration>
</plugin>

打入jar包:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
	<version>2.3.2</version>
	<configuration>
	    <archive>
		<menifest>
			<addClasspath>true</addClasspath>
			<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
			<addDeaaultSpecificationEntries>true</addDeaaultSpecificationEntries>
		</menifest>
		<manifestEntries>
			<url>${project.url}</url>
			<SVN-Revision>${buildNumber}</SVN-Revision>
		</manifestEnties>
  	     </archive>
	</configuration>
</plugin>

你可能感兴趣的:(通过buildnumber-maven-plugin把svn版本号打入jar或war包中)