如何编写获取方法的Nexus REST API? [英] How to write Get method Nexus Rest Api?

查看:2165
本文介绍了如何编写获取方法的Nexus REST API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的groupId 的artifactId 版本。我怎样写才能得到进一步的神器描述使用的Nexus REST API GET请求?

I have groupId, artifactId and version. How do i write a GET request using Nexus Rest API in order to get further artifact description?

推荐答案

不知道你要找什么样的信息。

Not sure what information you're looking for.

在REST API DOCO是availble的位置:

The REST API doco is availble here:

  • Core API
  • Lucene API

您已经开始使用:的groupId 的artifactId 版本

You're starting with: groupId, artifactId, version:

$ curl --silent 'http://repository.sonatype.org/service/local/lucene/search?g=log4j&a=log4j&v=1.2.16' | grep repositoryId
<repositoryId>central-proxy</repositoryId>
<repositoryId>apache-staging</repositoryId>
<repositoryId>central-proxy</repositoryId>
<repositoryId>apache-staging</repositoryId>

repositoryId 是必须在其他API调用

The repositoryId is mandatory in other API calls

$ curl --silent 'http://repository.sonatype.org/service/local/artifact/maven/resolve?r=central-proxy&g=log4j&a=log4j&v=1.2.16' 
<artifact-resolution>
  <data>
    <presentLocally>true</presentLocally>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.16</version>
    <extension>jar</extension>
    <snapshot>false</snapshot>
    <snapshotBuildNumber>0</snapshotBuildNumber>
    <snapshotTimeStamp>0</snapshotTimeStamp>
    <sha1>7999a63bfccbc7c247a9aea10d83d4272bd492c6</sha1>
    <repositoryPath>/log4j/log4j/1.2.16/log4j-1.2.16.jar</repositoryPath>
  </data>

检索POM

$ curl --silent 'http://repository.sonatype.org/service/local/artifact/maven?r=central-proxy&g=log4j&a=log4j&v=1.2.16'

提取罐

$ curl --silent 'http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=1.2.16'

这篇关于如何编写获取方法的Nexus REST API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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