summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2007-10-22 13:02:47 +0000
committerBrett Porter <brett@apache.org>2007-10-22 13:02:47 +0000
commit7ada562597b3f1a6bf2a0be854f32eee6f0d1135 (patch)
treee78adcfd059e17c0e53228b5bb3b6a92c0cb7541
parent19afbc4ac829c4cd23f995e2d663c106bedb5bc7 (diff)
downloadarchiva-7ada562597b3f1a6bf2a0be854f32eee6f0d1135.tar.gz
archiva-7ada562597b3f1a6bf2a0be854f32eee6f0d1135.zip
[MRM-559] fix version setting
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@587079 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java29
-rw-r--r--archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp4
2 files changed, 21 insertions, 12 deletions
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 = "<Unknown 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" %>
<html>
<head>
@@ -176,7 +176,7 @@
%>
<div id="footer">
<div class="xleft">
- Apache Archiva <%= ArchivaVersion.VERSION %>
+ Apache Archiva <%= ArchivaVersion.getVersion() %>
</div>
<div class="xright">
Copyright &#169; <%= copyrightRange %> Apache Software Foundation