如何从应用程序查询Maven存储库以获取元数据

问题描述 投票:0回答:2

我正在尝试将 Eclipse 项目迁移到 Maven 项目。 eclipse 项目在其 .classpath 文件中引用了许多 jar。 我正在寻找一种方法来生成相应的pom依赖项。

假设我有 Velocity-3.1.jar,我希望我的应用程序生成相应的 XML 块:

  <dependency>
    <groupId>velocity</groupId>
    <artifactId>Apache-velocity</artifactId>
    <version>3.1</version>
  </dependency>

应用程序能够查询某些服务并找到 groupId、artefactId、版本数据。

当然,我接受错误并会检查生成的元数据。

是否有一些 Maven 服务/插件可以做到这一点?

非常感谢!

maven
2个回答
7
投票

您可以使用maven中央存储库API。

查看官方页面:http://search.maven.org/#api

嗨 M.


5
投票

maven 中央存储库 API 的官方页面已更改。这是新网址

https://central.sonatype.org/search/rest-api-guide/

© www.soinside.com 2019 - 2024. All rights reserved.