Ruby Programmer/Developer

George Armhold's Blog

Data-driven webapps built with Ruby, Java & Wicket

Automatically Generate Maven Dependency Coordinates for Random Jar Files

Have you just inherited an Ant project that you’re trying to convert to Maven? Maybe it came with a “lib” directory full or random jar files. And worse, some thoughtless developer neglected to include version strings in the filenames?

Fear not! The Sonatype checksum search┬áREST service can give you the Maven coordinates based on the jar’s SHA1 hash.

Still too much work? Not to worry, I just wrote a quick program to make it even easier for you. Provenance will take a directory full of jar files and write out the XML dependency information for every jar it finds. You can then copy/paste this right into the <dependencies> section of your pom.xml.