如何找到 jar 中定义的包? [英] How do I find the packages defined in a jar?

查看:19
本文介绍了如何找到 jar 中定义的包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆 JAR 文件(来自 maven2 项目)并且 maven 报告找不到某些包(确切地说是 org.openanzo.client.jena).我想深入研究作为 maven 依赖项解析结果下载的 JAR 文件,并从这些 JAR 文件中找到哪些包可用.见解?

I have a bunch of JAR files (from a maven2 project) and maven reports some package could not be found (org.openanzo.client.jena to be exact). I want to dig into the JAR files downloaded as the result of maven dependency resolution and find what packages are thus available from these JAR files. Insights?

更新:显然,检查 jar 文件内部的唯一好的解决方案是jar"实用程序,或者可以使用其 IDE 的工具来执行此操作.

UPDATE: Apparently, the only good solution to inspect insides of a jar file is the "jar" utility or one can use the facilities of their IDE to do so.

推荐答案

jar tvf filename.jar 无需解压即可显示 jar 文件的内容.

jar tvf filename.jar will show you the contents of a jar file without requiring you to extract it.

但我认为,也许您真正想做的是为您缺少的依赖项找到正确的坐标,因为显然您现在拥有的所有坐标都没有提供您正在寻找的包(换句话说,检查它们的内容可能对您没有帮助).

But I think that maybe what you are really trying to do is find the right coordinates for the dependency that you are missing, since obviously none of the ones you have right now are supplying the package you are looking for (in other words, checking their contents is not likely to help you).

我承认我建议首先检查的是 Sonatype 的公共 Nexus 实例.但是,搜索您的示例没有任何结果.通常这意味着项目不会尝试将他们的东西放入 Maven Central 或其他主要存储库(这没关系),因此您必须求助于网络搜索.通常包的前两部分会告诉您在哪里查看(在您的情况下为 openanzo.org).

I confess that the first place I would suggest to check is Sonatype's public Nexus instance. A search for your example turns up nothing, though. Usually that means the project is not trying to get their stuff into Maven Central or other major repositories (which is okay), so you have to resort to a web search. Usually the first two sections of the package tell you where to look (openanzo.org in your case).

这篇关于如何找到 jar 中定义的包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆