开发者

Maven: how to identify jar files by SHA

I've inherited an Ant-based project that has over 80MB of jar files in a lib dir. I'd like to convert it to Mave开发者_开发百科n. The jar files are named very simply, like quartz.jar. Since there is no indication of group id, much less version, converting this to pom.xml format is going to be very painful.

Is there a service or API that will return the Maven coordinates (group, artifact, version) for a jar file, given its SHA?

My fallback will be to examine the MANIFEST file from each jar, which will at least give me version info, if not specific Maven coordinates.


Ah, looks like I needed to Google on "checksum search", rather than "SHA". That turned up this page:

How to Convert from Ant to Maven in 5 Minutes

... which explains that you can use the checksum search on this page.

Based on this info, I just coded up a quick project on Github that will use this API and generate the XML dependencies stanza automatically. You can use it like:

$ java com.armhold.Provenance lib_dir

And it will print out the Maven coords for each jar file it finds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜