From 50f5ab4110aeece8a75909558860b46eb8d042ba Mon Sep 17 00:00:00 2001 From: asbachb Date: Tue, 10 Apr 2012 09:25:08 +0200 Subject: [PATCH] Read version bundled pom.xml --- .gitignore | 3 ++- pom.xml | 2 +- src/main/java/de/asbach/nmaster/core/Version.java | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a6f89c2..6e27347 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/target/ \ No newline at end of file +/target/ +/nbactions.xml diff --git a/pom.xml b/pom.xml index 389ba6e..c614e7a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.asbach grademasterflash jar - 1.1.3 + 1.1.4 grademasterflash http://foo.bluebug.de/grademasterflash/ diff --git a/src/main/java/de/asbach/nmaster/core/Version.java b/src/main/java/de/asbach/nmaster/core/Version.java index 41f76c9..922c0d5 100644 --- a/src/main/java/de/asbach/nmaster/core/Version.java +++ b/src/main/java/de/asbach/nmaster/core/Version.java @@ -100,9 +100,13 @@ private String getVersionFromJar() throws IOException{ } private String getVersionFromPom() throws IOException, JDOMException { - Document doc = new SAXBuilder().build( - new File(System.getProperty("user.dir") + - File.separator + "pom.xml")); + Document doc = new SAXBuilder() + .build( + Thread + .currentThread() + .getContextClassLoader() + .getResourceAsStream( + "META-INF/maven/de.asbach/grademasterflash/pom.xml")); Element rootElement = doc.getRootElement();