atom feed6 messages in org.apache.maven.usersAccessing project version number from...
FromSent OnAttachments
Dominic MitchellSep 29, 2008 5:03 am 
Brett PorterSep 29, 2008 5:08 am 
Mark HobsonSep 29, 2008 5:22 am 
Dominic MitchellSep 29, 2008 5:31 am 
Dominic MitchellSep 29, 2008 5:36 am 
Lee MeadorSep 29, 2008 5:16 pm 
Subject:Accessing project version number from Java
From:Dominic Mitchell (do@semantico.com)
Date:Sep 29, 2008 5:03:38 am
List:org.apache.maven.users

What's the easiest way to get at the version number in the POM from Java?

I've been using getResourceAsStream('META-INF/maven/groupId/artifactId/ pom.properties'); But this doesn't work while I'm developing in Eclipse (only when using the built jar file).

Ideally, I'd like to somehow generate a Java class which contains the version number. I thought I should be able to do this using resource filtering, but I couldn't see a way to configure the resources plugin to achieve this…

Any help would be most gratefully appreciated.

Thanks, -Dom