From baa9a7cada496fb9776e0dcf3ea71c26c568c0de Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Mon, 4 Aug 2008 06:34:41 +0000 Subject: [PATCH] [MRM-895] submitted by Mark Jeffrey -no longer pass the class loader in ArchivaVersion.determineVersion() git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@682269 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/web/startup/ArchivaVersion.java | 13 +++++++------ .../apache/maven/archiva/web/startup/Banner.java | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java index 34ab2f282..ea78d8761 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java @@ -19,14 +19,14 @@ package org.apache.maven.archiva.web.startup; * under the License. */ -import org.apache.commons.lang.StringUtils; -import org.apache.commons.io.IOUtils; - import java.io.IOException; import java.io.InputStream; -import java.net.URL; import java.util.Properties; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; + /** * ArchivaVersion * @@ -41,14 +41,15 @@ public class ArchivaVersion { } - public static String determineVersion( ClassLoader cloader ) + public static String determineVersion( ) { if ( version != null ) { return version; } - InputStream is = cloader.getResourceAsStream( "/META-INF/maven/org.apache.archiva/archiva-configuration/pom.properties" ); + InputStream is = ArchivaConfiguration.class.getResourceAsStream( "/META-INF/maven/org.apache.archiva/archiva-configuration/pom.properties" ); + if ( is != null ) { try diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java index 27775bf08..ea090e624 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java @@ -220,7 +220,7 @@ public class Banner public void display() { - String banner = getBanner( ArchivaVersion.determineVersion( this.getClass().getClassLoader() ) ); - LoggerFactory.getLogger( Banner.class ).info( StringUtils.repeat( "_", 25 ) + "\n" + banner ); + String banner = getBanner( ArchivaVersion.determineVersion() ); + LoggerFactory.getLogger( Banner.class ).info( StringUtils.repeat( "_", 25 ) + "\n" + banner ); } } -- 2.39.5