You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/11/18 18:21:36 UTC

svn commit: r345526 - in /webservices/axis2/trunk/java/modules: common/maven.xml common/src/org/apache/axis2/Version.java common/src/org/apache/axis2/i18n/resource.properties samples/src/sample/axisversion/Version.java

Author: dims
Date: Fri Nov 18 09:21:29 2005
New Revision: 345526

URL: http://svn.apache.org/viewcvs?rev=345526&view=rev
Log:
Adding version support (from Axis1.X)


Added:
    webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/Version.java
Modified:
    webservices/axis2/trunk/java/modules/common/maven.xml
    webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties
    webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java

Modified: webservices/axis2/trunk/java/modules/common/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/common/maven.xml?rev=345526&r1=345525&r2=345526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/common/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/common/maven.xml Fri Nov 18 09:21:29 2005
@@ -15,4 +15,15 @@
             <j:expr value="${context.setVariable('maven.itest.skip', 'true')}"/>
         </j:if>
     </preGoal>
+
+    <postGoal name="java:jar-resources">
+      <tstamp>
+        <format property="build.time" pattern="MMM dd, yyyy (hh:mm:ss z)" locale="en"/>
+      </tstamp>
+      <replace dir="${maven.build.dest}/org/apache/axis2/i18n">
+        <include name="resource*.properties"/>
+        <replacefilter token="#today#" value="${build.time}"/>
+        <replacefilter token="#axisVersion#" value="${pom.currentVersion}"/>
+      </replace> 
+    </postGoal>
 </project>

Added: webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/Version.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/Version.java?rev=345526&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/Version.java (added)
+++ webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/Version.java Fri Nov 18 09:21:29 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis2;
+
+import org.apache.axis2.i18n.Messages;
+
+/**
+ * Little utility to get the version and build date of the axis.jar.
+ * <p/>
+ * The messages referenced here are automatically kept up-to-date by the
+ * build.xml.
+ *
+ * @author Glen Daniels (gdaniels@apache.org)
+ */
+public class Version {
+    /**
+     * Get the version of this AXIS.
+     *
+     * @return the version of this axis
+     */
+    public static String getVersion() {
+        return Messages.getMessage("axisVersion") + "\n" +
+                Messages.getMessage("builtOn");
+    }
+
+    /**
+     * Returns the Axis Version number and build date.
+     * <p/>
+     * Example output: 1.1 Jul 08, 2003 (09:00:12 EDT)
+     *
+     * @return the full version of this axis
+     */
+    public static String getVersionText() {
+        return Messages.getMessage("axisVersionRaw") + " " + Messages.getMessage("axisBuiltOnRaw");
+    }
+
+    /**
+     * Entry point.
+     * <p/>
+     * Calling this with no arguments returns the version of the client-side
+     * axis.jar.
+     */
+    public static void main(String[] args) {
+        System.out.println(getVersion());
+    }
+}

Modified: webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties?rev=345526&r1=345525&r2=345526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties Fri Nov 18 09:21:29 2005
@@ -13,6 +13,16 @@
 #     translated unless your translated file, rather than this file,
 #     will serve as a base for other translators.
 
+#############################################################################
+# DO NOT TOUCH THESE PROPERTIES - THEY ARE AUTOMATICALLY UPDATED BY THE BUILD
+# PROCESS.
+axisVersion=Apache Axis2 version: #axisVersion#
+axisVersionRaw=#axisVersion#
+axisBuiltOnRaw=#today#
+axisUserAgent=Axis/#axisVersion#
+builtOn=Built on #today#
+#############################################################################
+
 threadpoolshutdown=Thread pool has already been shutdown
 errorWhileSafeShutDown=Error while safe shutdown
 invaliduser=Invalid user name

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java?rev=345526&r1=345525&r2=345526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java Fri Nov 18 09:21:29 2005
@@ -29,7 +29,7 @@
         OMElement version = fac.createOMElement("Version", omNs);
         version.addChild(
                 fac.createText(version,
-                        "Hello I am Axis2 version service , My version is Axis2 0.92 !! "));
+                        "Hello I am Axis2 version service , My version is " + org.apache.axis2.Version.getVersionText()));
         return version;
     }
 }