Read version from .jar file

Hey SciJava folks,

I remember there is a function somewhere that can tell me during runtime the version of the jar file of a given class… I think it lives in SciJava-something but I can’t find it anymore.

Any hint is appreciated :slightly_smiling_face:

Cheers,
Robert

There’s VersionUtils.getVersion(Class) (static) as well as POM#getVersion() (not static).

I think there was a plan to consolidate those two, but I guess you can use either of them as long as they’re not deprecated (yet).

EDIT:

I found the GitHub issue I remembered, it was about compareVersions(), not getVersion():

2 Likes

Fantastic, thanks Jan! :star_struck: