使用 Nexus rest API 获取给定 groupid/artifactId 的最新工件版本 [英] Using the Nexus rest API to get latest artifact version for given groupid/artifactId

查看:47
本文介绍了使用 Nexus rest API 获取给定 groupid/artifactId 的最新工件版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 nexus REST api 来获取最新版本的 Maven 工件.我可以使用 http://repo.local/service/local/data_index?a=local-turbogears-server&from=0&g=com.turbo&c 浏览到我正在寻找的特定版本=bin&v=1.1.9 如果我删除版本参数,我可以看到每个版本.但是,当我尝试使用 RELEASE 或 LATEST 作为版本时,它返回零结果.我检查了 nexus 中磁盘上的 maven-metadata.xml,并且有最新和发布的条目.我还需要采取其他步骤来返回最新版本吗?

I am trying to use the nexus REST api to get the latest version of a maven artifact. I am able to browse to the specific version I am looking for using http://repo.local/service/local/data_index?a=local-turbogears-server&from=0&g=com.turbo&c=bin&v=1.1.9 and if I remove the version parameter I can see every version. However when I try and use RELEASE or LATEST as the version then it returns zero results. I checked the maven-metadata.xml on disk in nexus and there are entries for latest and release. Is there another step I need to take to return the latest version?

我目前正在使用:

Nexus v. 1.9.2

Nexus v. 1.9.2

推荐答案

以下 URL 将检索 log4j 1.2.x 的最新版本:

The following URL will retrieve the latest version of log4j 1.2.x:

http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST

记录在此处

使用 curl 的示例:

Example using curl:

curl -L "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST" -o log4j.jar

Log4j2 的更新

Log4j 1.2 从 2015 年夏天开始停产,并且在 Java 9 中被破坏.

Update for Log4j2

Log4j 1.2 is EOL since summer 2015 and is known to be broken in Java 9.

这是 Log4j 工件的链接:

Here is the link for the Log4j artifacts:

这篇关于使用 Nexus rest API 获取给定 groupid/artifactId 的最新工件版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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