Once again, a very good example of a good process very badly documented.
When you search for « nexus api example » in Google, the first result is: http://books.sonatype.com/nexus-book/reference/confignx-sect-plugins.html. Waw, for a single time, the first result is not Stackoverflow! I thought it was the beginning of a clear documentation. But it was not the case, at all.
When you follow the link, you have no further exaplaination than a screenshot leading you to your local Nexus installation (http://your.nexus.url/nexus/nexus-restlet1x-plugin/default/docs/index.html), the definition of a Maven dependency, and a link to a complicated GitHub project dealing with other things than the API itself. What? Seriously?
I had a simple requirement: being able to download an artifact that is on my Nexus, to the file system of a local machine. Maven does that evrytime for you, right? So, thanks to Google, Github and a few neurones, I came with a very small project that is hosted here: https://github.com/toni07/nexus-api-client
With these small sources, you will be able:
- to find all the versions for a given artifact-id
- to download a given Maven artifact to your local drive
(ps: do not try to search for a pure Java based API, I lost time with the « nexus-client-core » artifact, that contains deprecated methods, no Javadoc, and no examples. With this uncomplete API there is no method to download an artifact).