From: Joakim Erdfelt Date: Fri, 19 Oct 2007 22:21:54 +0000 (+0000) Subject: Adding version into footer X-Git-Tag: archiva-1.0-beta-3~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e74ebe51b78f67b7fb4a4fa8db518a28ed8b9488;p=archiva.git Adding version into footer git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@586630 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java index 78d2dc391..7b433f536 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java @@ -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 ) diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp index 95836dfa6..eca75b754 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp @@ -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" %> + Apache Archiva \ @@ -173,8 +175,11 @@ } %> <div id="footer"> - <div class="xright">© - Copyright © <%= copyrightRange %> Apache Software Foundation + <div class="xleft"> + Apache Archiva <%= ArchivaVersion.VERSION %> + </div> + <div class="xright"> + Copyright © <%= copyrightRange %> Apache Software Foundation </div> <div class="clear">