openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r588032 - in /openjpa/branches/1.0.x: openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java openjpa-lib/pom.xml
Date Wed, 24 Oct 2007 21:18:28 GMT
Author: mikedd
Date: Wed Oct 24 14:18:28 2007
New Revision: 588032

URL: http://svn.apache.org/viewvc?rev=588032&view=rev
Log:
Port 570487 to 1.0.x

Modified:
    openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
    openjpa/branches/1.0.x/openjpa-lib/pom.xml

Modified: openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java?rev=588032&r1=588031&r2=588032&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
(original)
+++ openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
Wed Oct 24 14:18:28 2007
@@ -45,8 +45,21 @@
     public static final String REVISION_NUMBER;
 
     static {
-        Package pack = OpenJPAVersion.class.getPackage();
-        String vers = pack == null ? null : pack.getImplementationVersion();
+        Properties revisionProps = new Properties();
+        try {
+            InputStream in = OpenJPAVersion.class.getResourceAsStream
+                ("/META-INF/org.apache.openjpa.revision.properties");
+            if (in != null) {
+                try {
+                    revisionProps.load(in);
+                } finally {
+                    in.close();
+                }
+            }
+        } catch (Exception e) {
+        }
+
+        String vers = revisionProps.getProperty("openjpa.version");
         if (vers == null || "".equals(vers.trim()))
             vers = "0.0.0";
         VERSION_NUMBER = vers;
@@ -71,21 +84,7 @@
             patch = 0;
         }
 
-        String revision = "";
-        try {
-            InputStream in = OpenJPAVersion.class.getResourceAsStream
-                ("/META-INF/org.apache.openjpa.revision.properties");
-            if (in != null) {
-                try {
-                    Properties props = new Properties();
-                    props.load(in);
-                    revision = props.getProperty("revision.number");
-                } finally {
-                    in.close();
-                }
-            }
-        } catch (Exception e) {
-        }
+        String revision = revisionProps.getProperty("revision.number");
 
         MAJOR_RELEASE = major;
         MINOR_RELEASE = minor;

Modified: openjpa/branches/1.0.x/openjpa-lib/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-lib/pom.xml?rev=588032&r1=588031&r2=588032&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-lib/pom.xml (original)
+++ openjpa/branches/1.0.x/openjpa-lib/pom.xml Wed Oct 24 14:18:28 2007
@@ -157,9 +157,11 @@
                                 <property name="subversion.revision"
                                     value="unknown"/>
                                 <echo>Revision: ${subversion.revision}</echo>
+                                <echo>OpenJPA version: ${project.version}</echo>
                                     
                                 <mkdir dir="${outdir}/META-INF"/>
-                                <echo file="${outdir}/META-INF/org.apache.openjpa.revision.properties">revision.number=${subversion.revision}</echo>
+                                <echo file="${outdir}/META-INF/org.apache.openjpa.revision.properties">revision.number=${subversion.revision}
+openjpa.version=${project.version}</echo>
                                 <delete dir="${tmpdir}"/>
                             </tasks>
                         </configuration>



Mime
View raw message