From: Brett Porter Date: Mon, 22 Oct 2007 13:02:47 +0000 (+0000) Subject: [MRM-559] fix version setting X-Git-Tag: archiva-1.0-beta-3~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7ada562597b3f1a6bf2a0be854f32eee6f0d1135;p=archiva.git [MRM-559] fix version setting git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@587079 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 7b433f536..172b1e222 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,18 +34,22 @@ import java.util.Properties; */ public class ArchivaVersion { - public static String VERSION = "Unknown"; - + private static String version = null; + + private ArchivaVersion() + { + } + public static String determineVersion( ClassLoader cloader ) { - if ( VERSION != null ) + if ( version != null ) { - return VERSION; + return version; } /* This is the search order of modules to find the version. */ - String modules[] = new String[] { + String[] modules = new String[] { "archiva-common", "archiva-configuration", "archiva-database", @@ -83,8 +87,8 @@ public class ArchivaVersion String version = props.getProperty( "version" ); if ( StringUtils.isNotBlank( version ) ) { - VERSION = version; - return VERSION; + ArchivaVersion.version = version; + return this.version; } } catch ( IOException e ) @@ -94,12 +98,17 @@ public class ArchivaVersion } } - return VERSION; + version = ""; + return version; } private static URL findModulePom( ClassLoader cloader, String module ) { - URL ret = cloader.getResource( "/META-INF/maven/org.apache.maven.archiva/" + module + "/pom.properties" ); - return ret; + return cloader.getResource( "/META-INF/maven/org.apache.maven.archiva/" + module + "/pom.properties" ); + } + + public static String getVersion() + { + return version; } } 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 eca75b754..9a51a0c45 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 @@ -24,8 +24,8 @@ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ 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" %> +<%@ page import="java.util.Calendar" %> @@ -176,7 +176,7 @@ %>