General tip: Finding the version of a JAR

When you're converting an existing Ant project to Maven, one of the first tedious task is to find out the version of the jars that you had been using. Of course you can try to open the JAR and look for the Manifest file but alas in most cases the version is not filled...

Jon Strayer has posted another good tip on the Maven list:

I'm trying to integrate an existing project into our build cycle. None of the jars had version numbers in their names. The solution I came up with was to download md5.exe from http://www.fourmilab.ch/md5/ and use google to look up the digests it printed out.

In each case, the name of the file(s) goggle found was the version of the jar (quite often in a Maven repository somewhere).

I've just tried it and it failed in the 2 cases I've tried (radeox.jar and ldap.jar files). No wonder, I knew they're not on ibiblio! I've then tried it on a "simple" one: struts. And it worked nicely! So that should solve most of your needs. There'll always be some edge cases though.

Thanks Jon for this very nice tip.