*/
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",
String version = props.getProperty( "version" );
if ( StringUtils.isNotBlank( version ) )
{
- VERSION = version;
- return VERSION;
+ ArchivaVersion.version = version;
+ return this.version;
}
}
catch ( IOException e )
}
}
- 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;
}
}
<%@ 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>
%>
<div id="footer">
<div class="xleft">
- Apache Archiva <%= ArchivaVersion.VERSION %>
+ Apache Archiva <%= ArchivaVersion.getVersion() %>
</div>
<div class="xright">
Copyright © <%= copyrightRange %> Apache Software Foundation