Handle Exeptions to eliminate issues when testing / debugging in IDE's and allow application to run with a default fversion if pom cannot be determined.,

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4743 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2010-02-07 00:35:14 +00:00
parent edf94a15f1
commit 3035d3a7c8

View File

@@ -346,14 +346,23 @@ public class Util {
* @return string containing version, e.g. "1.5.2"; ends in "-SNAPSHOT" for development versions.
*/
public static String getSourceVersion()
throws IOException
{
if (sourceVersion == null)
{
InputStream cis = Util.class.getResourceAsStream
("/META-INF/maven/org.dspace/dspace-api/pom.properties");
Properties constants = new Properties();
constants.load(cis);
try
{
InputStream cis = Util.class.getResourceAsStream
("/META-INF/maven/org.dspace/dspace-api/pom.properties");
constants.load(cis);
}
catch(Exception e)
{
log.error(e.getMessage(),e);
}
sourceVersion = constants.getProperty("version", "none");
}
return sourceVersion;