Apache Archiva 的工件的最新版本

发布于 2024-11-30 00:35:10 字数 302 浏览 1 评论 0 原文

archiva 上是否有某种参数化的 url,我可以在其中获取工件的最新快照/版本? 喜欢某事 https://myhappyarchiva.com/archiva /repository/com.example/com/example/myproject/LATEST/myproject-LATEST.jar

Is there some kind of parametrized url on archiva, where I can get the latest snapshot/release of an artifact?
sth like
https://myhappyarchiva.com/archiva/repository/com.example/com/example/myproject/LATEST/myproject-LATEST.jar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清秋悲枫 2024-12-07 00:35:10

尝试类似的方法:
http://myhappyarchiva.com/archiva/restServices/archivaServices/searchService/artifact?r=#releases&g=com.myhappyarchiva&a=myproject&v=LATEST

基础知识是:
http://[host_name]/archiva/restServices/archivaServices/searchService/artifact?r=[release_option]&g=[group_id]&a=[artifact_id]&v=[版本] &c=[classifer]"

  • [host_name] 类似于:dev.foo.com
  • [release_option] 类似于:“snapshots” 或“releases”
  • [group_id] 类似于: com.foo
  • [版本] 类似于:LATEST 或某个数字,例如 1.0
  • [classifer] 类似于:javadoc、源代码或程序集

标签显示在 archive 上的表格中。这样您就可以轻松查找参考文献。

我相信你也可以使用“p”来包装。它可以像:“jar”,“pom”,“javadoc”基本文件类型。所以看起来像,
“&p=jar”添加到请求中。

如果您遵循请求,它有时会在存储库开始下载之前经历 307 临时重定向和 302 发现重定向。

您可以使用curl 或wget 来完成此操作。或者在脚本中(我制作了一个 ruby​​ 脚本)。

wget 的示例:
https://archiva.apache.org/docs/2.2.0 /userguide/querying-artifacts.html

Try something like:
"http://myhappyarchiva.com/archiva/restServices/archivaServices/searchService/artifact?r=#releases&g=com.myhappyarchiva&a=myproject&v=LATEST"

The basics are:
"http://[host_name]/archiva/restServices/archivaServices/searchService/artifact?r=[release_option]&g=[group_id]&a=[artifact_id]&v=[version]&c=[classifer]"

  • [host_name] is like: dev.foo.com
  • [release_option] is like: "snapshots" or "releases"
  • [group_id] is like: com.foo
  • [version] is like: LATEST or some number like 1.0
  • [classifer] is like: javadoc, sources, or assembly

The labels are displayed in the tables on archiva. So you can easily look up the references.

I believe you can use "p" to be packaging as well. It can be like: "jar","pom","javadoc" basically file types. So that would look like,
"&p=jar" added onto the request.

It you are following the requests it sometimes goes through a 307 temporary redirect and 302 found redirect before the repo starts to download.

You do this with curl or wget. Or in a script (I made a ruby script).

Example of wget:
https://archiva.apache.org/docs/2.2.0/userguide/querying-artifacts.html

蔚蓝源自深海 2024-12-07 00:35:10

该功能尚不可用,但是您可能想在 http://jira.codehaus.org 提交问题/浏览/MRM。相关问题是 http://jira.codehaus.org/browse/MRM-805

今天要实现这一目标,最好的办法是:

  • 使用 XMLRPC 接口检索版本并选择最新版本(如果适用于 Maven,则可以使用 Maven 库来执行此操作)[1] [2]
  • 如果您知道存储库将是 Maven 存储库,您可以从 Archiva 获取 maven-metadata.xml 文件并读取 元素

That feature is not yet available, however you might like to file an issue at http://jira.codehaus.org/browse/MRM. A related issue is http://jira.codehaus.org/browse/MRM-805.

To achieve this today, the best thing to do is either:

  • use the XMLRPC interface to retrieve the versions and select the latest (you can use Maven libraries to do that if it's for Maven) [1] [2]
  • if you know the repository will be a Maven repository, you can grab the maven-metadata.xml file from Archiva and read the <release> or <latest> element
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文