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

查看:106
本文介绍了使用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:

此处

使用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:

  • log4j-api: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.apache.logging.log4j&a=log4j-api&v=LATEST
  • log4j-core: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.apache.logging.log4j&a=log4j-core&v=LATEST

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

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