1

I want to get a list (json) of all artifacts in one specific repository via the REST API.

I've already tried:

curl -X GET http://localhost/nexus/service/local/respositories/<reponame>/content/

This works, but it deliveres me a json listing all my subdirectories in this repo. But what I want is a list with all the artifacts contained in all subdirectories.

Someone knows how to do this? Is there a way to iterate through all folders? I was thinking about the search keyword, but I wouldn't know for what to search.

030
  • 13,383
  • 17
  • 76
  • 178
alex
  • 51
  • 1
  • 1
  • 7

2 Answers2

2

Try this:

# Get status
curl http://localhost:8081/nexus/service/local/status 
# List of repositories
curl http://localhost:8081/nexus/service/local/repositories

For the json parameter:

curl -i -H "Accept: application/json" <url>

More information, see this link

dalmo.santos
  • 146
  • 5
0

For nexu3 this how to list artifact using curl:

curl -X GET "http://localhost:8081/nexus/service/rest/v1/search?repository={repository_name}&format=maven2&maven.groupId={groupeID}&maven.artifactId={ArtifactID}&maven.extension={package_type}" -H "accept: application/json"

Alioua
  • 101
  • 1