mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 22:13:08 +00:00
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:
@@ -346,14 +346,23 @@ public class Util {
|
|||||||
* @return string containing version, e.g. "1.5.2"; ends in "-SNAPSHOT" for development versions.
|
* @return string containing version, e.g. "1.5.2"; ends in "-SNAPSHOT" for development versions.
|
||||||
*/
|
*/
|
||||||
public static String getSourceVersion()
|
public static String getSourceVersion()
|
||||||
throws IOException
|
|
||||||
{
|
{
|
||||||
if (sourceVersion == null)
|
if (sourceVersion == null)
|
||||||
{
|
{
|
||||||
InputStream cis = Util.class.getResourceAsStream
|
|
||||||
("/META-INF/maven/org.dspace/dspace-api/pom.properties");
|
|
||||||
Properties constants = new 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");
|
sourceVersion = constants.getProperty("version", "none");
|
||||||
}
|
}
|
||||||
return sourceVersion;
|
return sourceVersion;
|
||||||
|
Reference in New Issue
Block a user