James Carman wrote: > On Wed, Sep 15, 2010 at 6:45 AM, sebb <seb...@gmail.com> wrote: >> >> I like the idea. >> >> Apache JMeter does the same. >> >> It also includes the last SVN revision of whatever workspace was used >> to build it. >> >> Since the version is available to Maven (or Ant) it could update (or >> perhaps create?) the version file as part of the build. >> >> If we decide to include the SVN revision as well, we could also add >> the SVN revision as a new manifest entry. >> >> Which makes me wonder - maybe another way to do this would be to have >> the getVersion() method read the Manifest entry? > > We use a method like this: > > public static String versionOf(Class c) { > final String version = c.getPackage().getImplementationVersion(); > return StringUtils.isEmpty(version) ? "n/a" : version; > } > > So, if you want to know what version of Hibernate you're using, you'd do: > > versionOf(org.hibernate.Session.class);
+1 - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org