]> source.dussan.org Git - archiva.git/commitdiff
Adding version into footer
authorJoakim Erdfelt <joakime@apache.org>
Fri, 19 Oct 2007 22:21:54 +0000 (22:21 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Fri, 19 Oct 2007 22:21:54 +0000 (22:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@586630 13f79535-47bb-0310-9956-ffa450edef68

archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp

index 78d2dc39166ca9f7c5c30180d54cd66bd69f312f..7b433f5361d8269716375f50bc82ddc5af5a9aa5 100644 (file)
@@ -34,8 +34,15 @@ import java.util.Properties;
  */
 public class ArchivaVersion
 {
+    public static String VERSION = "Unknown";
+    
     public static String determineVersion( ClassLoader cloader )
     {
+        if ( VERSION != null )
+        {
+            return VERSION;
+        }
+        
         /* This is the search order of modules to find the version.
          */
         String modules[] = new String[] {
@@ -60,7 +67,6 @@ public class ArchivaVersion
             "archiva-webapp",
             "archiva-security",
             "archiva-applet",
-            "archiva-cli",
             "archiva-xml-tools" };
 
         for ( int i = 0; i < modules.length; i++ )
@@ -77,7 +83,8 @@ public class ArchivaVersion
                     String version = props.getProperty( "version" );
                     if ( StringUtils.isNotBlank( version ) )
                     {
-                        return version;
+                        VERSION = version;
+                        return VERSION;
                     }
                 }
                 catch ( IOException e )
@@ -87,7 +94,7 @@ public class ArchivaVersion
             }
         }
 
-        return "Unknown";
+        return VERSION;
     }
 
     private static URL findModulePom( ClassLoader cloader, String module )
index 95836dfa6ea9cab09cf62205de885e2ad7f93ef6..eca75b7544ec9bfc41628b7949e9403eb58b5b70 100644 (file)
@@ -25,6 +25,8 @@
 <%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
 <%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
 <%@ page import="java.util.Calendar" %>
+<%@ page import="org.apache.maven.archiva.web.startup.ArchivaVersion" %>
+
 <html>
 <head>
   <title>Apache Archiva \
   }
 %>
 <div id="footer">
-  <div class="xright">&#169;
-    Copyright &copy; <%= copyrightRange %> Apache Software Foundation
+  <div class="xleft">
+    Apache Archiva <%= ArchivaVersion.VERSION %>
+  </div>
+  <div class="xright">
+    Copyright &#169; <%= copyrightRange %> Apache Software Foundation
   </div>
 
   <div class="clear">