cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1423175 - in /cxf/trunk/api: pom.xml src/main/java/org/apache/cxf/version/Version.java src/main/resources-filtered/org/apache/cxf/version/version.properties
Date Mon, 17 Dec 2012 21:55:05 GMT
Author: dkulp
Date: Mon Dec 17 21:55:03 2012
New Revision: 1423175

URL: http://svn.apache.org/viewvc?rev=1423175&view=rev
Log:
If using a SNAPSHOT version, output the svn rev# or git hash into the version string to get
some sort of idea of what version we are dealing with.

Modified:
    cxf/trunk/api/pom.xml
    cxf/trunk/api/src/main/java/org/apache/cxf/version/Version.java
    cxf/trunk/api/src/main/resources-filtered/org/apache/cxf/version/version.properties

Modified: cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/pom.xml?rev=1423175&r1=1423174&r2=1423175&view=diff
==============================================================================
--- cxf/trunk/api/pom.xml (original)
+++ cxf/trunk/api/pom.xml Mon Dec 17 21:55:03 2012
@@ -32,8 +32,10 @@
         <version>2.7.2-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
+    
 
     <properties>
+        <buildnumber.connection.url>${project.scm.developerConnection}</buildnumber.connection.url>
         <cxf.osgi.export>
             !org.apache.cxf.internal,
             org.apache.cxf.*,
@@ -167,6 +169,35 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>buildnumber-maven-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>create-noncanonicalrev</id>
+                            <goals>
+                                <goal>create-timestamp</goal>
+                            </goals>
+                        <configuration>
+                            <timestampFormat>'NON-CANONICAL_'yyyy-MM-dd_HH-mm_'${user.name}'</timestampFormat>
+                            <timestampPropertyName>nonCanonicalRevision</timestampPropertyName>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>create-buildnumber</id>
+                            <goals>
+                                <goal>create</goal>
+                            </goals>
+                            <configuration>
+                                <doCheck>false</doCheck>
+                                <doUpdate>false</doUpdate>
+                                <urlScm>${buildnumber.connection.url}</urlScm>
+                                <revisionOnScmFailure>${nonCanonicalRevision}</revisionOnScmFailure>
+                            </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.cxf</groupId>
                 <artifactId>cxf-xjc-plugin</artifactId>
                 <version>${cxf.xjc-utils.version}</version>
@@ -290,6 +321,18 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <!-- default profile enables javadoc stuff -->
+            <id>git.build.number</id>
+            <activation>
+                <file>
+                    <exists>../.git</exists>
+                </file>
+            </activation>
+            <properties>
+                <buildnumber.connection.url>scm:git:http://</buildnumber.connection.url>
+            </properties>
+        </profile>
     </profiles>
 
 </project>

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/version/Version.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/version/Version.java?rev=1423175&r1=1423174&r2=1423175&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/version/Version.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/version/Version.java Mon Dec 17 21:55:03 2012
@@ -27,6 +27,7 @@ public final class Version {
     private static String version;
     private static String name;
     private static String fullVersion;
+    private static String buildNumber;
     
     private static final String VERSION_BASE = "/org/apache/cxf/version/";
 
@@ -57,7 +58,13 @@ public final class Version {
 
             version = p.getProperty("product.version", "<unknown>");
             name = p.getProperty("product.name", "Apache CXF");
-            fullVersion = name + " " + version;
+            buildNumber = p.getProperty("build.number", "<unknown>");
+            if (version.contains("SNAPSHOT") 
+                || version.contains("<unknown>")) {
+                fullVersion = name + " " + version + " (" + buildNumber + ")";
+            } else {
+                fullVersion = name + " " + version;
+            }
         }
     }
 

Modified: cxf/trunk/api/src/main/resources-filtered/org/apache/cxf/version/version.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/resources-filtered/org/apache/cxf/version/version.properties?rev=1423175&r1=1423174&r2=1423175&view=diff
==============================================================================
--- cxf/trunk/api/src/main/resources-filtered/org/apache/cxf/version/version.properties (original)
+++ cxf/trunk/api/src/main/resources-filtered/org/apache/cxf/version/version.properties Mon
Dec 17 21:55:03 2012
@@ -19,4 +19,5 @@
 #
 #
 product.version=${project.version}
-product.name=Apache CXF
\ No newline at end of file
+product.name=Apache CXF
+build.number=${buildNumber}
\ No newline at end of file



Mime
View raw message