RSS feed
<< June 2007 | Home | August 2007 >>

Now, Which Jar Did I Put That In?

Imagine this scenario: you've got a directory full of jar files, and your build is failing because it's missing some classes that are in one of them. You're not sure which; only that the missing classes are in here somewhere. I've been running into this problem a lot lately, as I try to convert a series of old Ant builds over to Maven. At times, I've found that the jar name doesn't even come close to indicating whether it contains the key classes I need to make my build start working. To address this problem, I've started a short Ruby script that I'm tentatively calling jargrep.rb. Before I show you this, please remember that I'm a little green when it comes to Ruby, so there may be some elegant one-liner that I'm missing here or there...and it may look decidedly Java-ish to the "native" Ruby programmer. Oh, and I'm not looking to win any architectural or OO-design awards here; I only needed a script to scratch a very persistent itch. Finally, this script is lacking a lot of polish when it comes ...