寻找特定类或包的Maven仓库方法

huangapple go评论53阅读模式
英文:

How to look for the maven repository of a particular class or package

问题

在我的Maven项目中,我需要使用一个特定的类(具体来说,org.eclipse.rdf4j.model.util.Values.bnode)。然而,当我在Eclipse中导入它时,它逻辑上抱怨找不到它。
此外,当我在https://mvnrepository.com/上查找rdf4j的Maven仓库时,我找到了一堆,我不知道哪一个包含我正在寻找的类。

所以我的问题是:是否有一种简单的方法来查找包含特定类或包的Maven仓库?

提前感谢

顺便说一句。
我在一个在线教程中找到了这个类。但教程没有提供Maven配置或包信息,这一点非常不方便。教程应该始终提及如何设置环境和导入特定包(或至少指向另一个提供这些信息的网页)。

英文:

In my Maven project, I need to use a particular class (specifically, org.eclipse.rdf4j.model.util.Values.bnode) However, when I import it in Eclipse it logically complains it couldnt find it.
Further, when I look for the Maven repo of rdf4j in https://mvnrepository.com/, I find a bunch of them and I dont know which one contains the class I am looking for.

So my question is : is there a simple way to look for the Maven repository that contains a certain class or package?

Thx in advance

BTW.
I found this class in an online tutorial. But the turorial does not give the maven configuration or the package information, which is not convenient at all. Tutos should always mention how to set the environment and import specific packages (or at least point to another webpage that does).

答案1

得分: 2

个人我试图找到包含该类的项目的源代码库,然后我查看Maven配置(即pom.xml)以查看它所发布的groupId/artifactId。

有时,如果该类已移动和/或已被删除,您需要查看较早的Git标签。

英文:

Personally I try to find the source repo for the project that contains the class, then I look at the maven configuration (ie pom.xml) to see what groupId/artifactId it's published under.

Sometimes you will need to look at older git tags if the class has moved and/or been deleted.

答案2

得分: 0

以下是翻译好的部分:

查看具体项目网站通常是个好主意,如果这些依赖项没有被自动找到的话。

在这种情况下,RDF4J项目在其下载页面上提供了如何获取正确的Maven构件的说明。您还可以在Github仓库中查找,如果搜索类文件(在这种情况下是Values.java),您可以看到它属于哪个包和模块:它位于rdf4j/core/model目录下,该目录有一个模块POM,其中包含特定Maven构件的详细信息:

<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-model</artifactId>
英文:

Looking at the specific project website is usually a good idea if somehow these dependencies are not automatically found.

In this case, the RDF4J project gives instructions on how to get the right maven artifacts on its download page. You can also look in the Github repo, if you search for the class file (Values.java in this case) you can see what package and module it's in: it's in the rdf4j/core/model directory, which has a module POM that gives you the details of the specific maven artifact:

	&lt;groupId&gt;org.eclipse.rdf4j&lt;/groupId&gt;
	&lt;artifactId&gt;rdf4j-model&lt;/artifactId&gt;

huangapple
  • 本文由 发表于 2023年5月24日 18:27:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76322526.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定