commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject RE: Version classes
Date Wed, 15 Sep 2010 15:57:29 GMT

That looks like a nice utility to add to [lang].

My preference would be for the sig "getVersion(Class)"


-----Original Message-----
From: [] On Behalf Of James
Sent: Wednesday, September 15, 2010 03:55
To: Commons Developers List
Subject: Re: Version classes

On Wed, Sep 15, 2010 at 6:45 AM, sebb <> 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:


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message