从Maven Central动态链接到最新的'jar-with-dependencies'

时间:2013-02-13 07:30:48

标签: maven nexus sonatype maven-central

我正在尝试使用Maven central API为最新版本的工件提供动态下载链接。虽然这适用于普通的jar,但我似乎无法将其链接到工件的'jar-with-dependencies'版本。

使用com.ning:nagios工件,可以在

下载最新版本

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

假设我可以使用l查询参数(基于链接的API)来指定'jar-with-dependencies'分类器,但链接只下载正常广口瓶中。

http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.ning&a=nagios&v=LATEST&l=jar-with-dependencies

有没有办法链接到这个版本的工件?

1 个答案:

答案 0 :(得分:5)

对于重定向下载服务,分类器参数为'c',而不是Solr API中使用的'l'(在该API 'c'中是'classname') - 所以这将有效:

https://search.maven.org/remote_content?g=com.ning&a=nagios&v=LATEST&c=jar-with-dependencies

(注意,更新 Sonatype put BASIC auth on the old url之后 - 我们现在在maven.org上使用这个新的官方下载网址

下载包含依赖项的1.2MB jar(不是常规jar) - 目前最新版本为nagios-0.0.2-jar-with-dependencies.jar

相关问题