Browse Source

因为切换到 git 仓库,打包时前端代码中的后缀不再使用 svn 版本号,改为时间戳

sunyj 8 years ago
parent
commit
403204f48c
1 changed files with 15 additions and 21 deletions
  1. 15 21
      pom.xml

+ 15 - 21
pom.xml

@@ -301,31 +301,25 @@
 
 	<build>
 		<plugins>
+			<!-- 在maven生命周期validate阶段生成timestamp -->
 			<plugin>
-				<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
-				<artifactId>svn-revision-number-maven-plugin</artifactId>
-				<version>1.13</version>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>buildnumber-maven-plugin</artifactId>
+				<version>1.3</version>
 				<executions>
 					<execution>
+						<phase>validate</phase>
 						<goals>
-							<goal>revision</goal>
+							<goal>create-timestamp</goal>
 						</goals>
 					</execution>
 				</executions>
 				<configuration>
-					<entries>
-						<entry>
-							<prefix>svn</prefix>
-						</entry>
-					</entries>
+					<format>{0,date,yyyy-MM-dd HH:mm:ss}</format>
+					<items>
+						<item>timestamp</item>
+					</items>
 				</configuration>
-				<dependencies>
-					<dependency>
-						<groupId>org.tmatesoft.svnkit</groupId>
-						<artifactId>svnkit</artifactId>
-						<version>1.8.10</version>
-					</dependency>
-				</dependencies>
 			</plugin>
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
@@ -378,7 +372,7 @@
 							</sourceIncludes>
 							<!-- http://static.ubtoc.com/css/index.css?_v=1450321871828 -->
 							<versionSuffix>
-								<suffix>?_v=${svn.revision}</suffix>
+								<suffix>?_v=${timestamp}</suffix>
 								<exclude>resources/lib/**/*</exclude>
 							</versionSuffix>
 						</configuration>
@@ -415,17 +409,17 @@
 								<pluginExecution>
 									<pluginExecutionFilter>
 										<groupId>
-											com.google.code.maven-svn-revision-number-plugin
+											org.codehaus.mojo
 										</groupId>
 										<artifactId>
-											svn-revision-number-maven-plugin
+											buildnumber-maven-plugin
 										</artifactId>
 										<versionRange>
-											[1.13,)
+											[1.3,)
 										</versionRange>
 										<goals>
 											<goal>
-												revision
+												create-timestamp
 											</goal>
 										</goals>
 									</pluginExecutionFilter>