gpt4 book ai didi

maven - 如何填充 Maven 中心的标签元数据字段下索引的内容?

转载 作者:行者123 更新时间:2023-12-05 06:40:24 26 4
gpt4 key购买 nike

Maven Central 的 search facility提供几个不同的字段供您搜索。最熟悉的当然是组 ID、 Artifact ID 和版本。但还有其他人。例如,下面是一个搜索名为 tags 的字段的查询:

http://search.maven.org/#search%7Cga%7C1%7Ctags%3Asbtplugin

如果您在该列表中选择一个 Artifact 并深入研究它,您确实会发现(一旦您越过损坏的链接!)pom.xml 有一个 sbtVersion属性。

我想,也许这就是填充 tags 字段的方式:只需在 properties 节中添加任意属性。当然,上面寻找的标签是 sbtplugin 而检查的属性是 sbtVersion,所以很明显还涉及其他东西,但我找不到任何地方记录该机制。

那么如何填充这个索引字段?它是 Nexus 特定的功能吗?我可以使用 maven-deploy-plugin 来填充它吗,它的目标似乎并没有暗示这样的事情?

如果我可以控制在该字段中输入的内容,那么能够以编程方式搜索该字段将非常非常有帮助。

最佳答案

Sonatype 的 Joel Orlina 写道:

Older versions of the indexer that backs search.maven.org populated the tags field with the contents of the <description> element in the POM. The field is passed through some standard StopWord filters and maybe some other Lucene analyzers, so the full contents won't make it into the tags field. We made some changes a couple years back to help out the scala/sbt community where, based on specific elements we discover in scala/sbt-plugin poms, we synthesize three tags: sbtPlugin, sbtVersion, and scalaVersion. This allows users of sbt plugins to search for those types of artifacts, which, in many cases don't conform to the Maven2 repository layout and, as such, don't normally get indexed by the search.maven.org indexer.

There's not much else to the tags field.

关于maven - 如何填充 Maven 中心的标签元数据字段下索引的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42729444/

26 4 0