Skip to content

Commit

Permalink
Read version bundled pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
asbachb committed Apr 10, 2012
1 parent 52e6532 commit 50f5ab4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/target/
/nbactions.xml
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.asbach</groupId>
<artifactId>grademasterflash</artifactId>
<packaging>jar</packaging>
<version>1.1.3</version>
<version>1.1.4</version>
<name>grademasterflash</name>
<url>http://foo.bluebug.de/grademasterflash/</url>
<developers>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/de/asbach/nmaster/core/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 50f5ab4

Please sign in to comment.