0

Is there a way to get the the remote url of an artifact stored by Nexus 3 OSS? Or even the id of the repo if a group is used.

I tried with the REST APIs but there isn't what I'm looking for.

I'm trying to create a maven plugin that lists remote urls of every dependency in a project.

Example:

org.apache.commons:commons-lang3:jar:3.8.1 -----> http://central.maven.org/maven2/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar

Alf
  • 2,291
  • 1
  • 28
  • 34
  • Can you clarify what you're looking for? Or what you're not looking for (e.g what REST doesn't do)? I don't want to answer then not help:P – joedragons Nov 28 '18 at 23:35
  • @joedragons: I added an example. Obviously for maven the download url is `http://my-nexus-server/public/...`. Only nexus can know the remote url, if it is stored somewhere. – Alf Nov 29 '18 at 08:09
  • The reason this plugin doesnt exist yet is because it would bring no information : the root url is constant (you can see it in your "" maven settings), and about the variable part, you can see it in any dependency tree. – Tristan Dec 03 '18 at 08:39
  • @Tristan: infact I want to get this info from nexus. – Alf Dec 03 '18 at 12:17
  • @Tristan: I know the url of the artifact in my nexus repository, I need the remote repo url. – Alf Dec 03 '18 at 12:24
  • Ok, but it looks like the information u need is not rly dynamic, it's just Nexus settings. So there is no real reason Nexus would expose these informations as REST api. – Tristan Dec 03 '18 at 13:59
  • @Tristan: no if you use group repos. Suppose you have two proxy repos (codehaus and jboss for instance) and you create a group repo for the two. When maven queries nexus for an artifact, nexus tries to downoad it from codehaus. If codehaus does not have such artifact then tries with jboss. I cannot infer the download url upfront. Infact in my question I asked a way to get the repo's id if there was no way to get the remote url directly – Alf Dec 03 '18 at 15:55
  • Ok, but I was not thinking about getting all the exact informations, I was thinking about the goal of getting them. The only goal I can see is to allow developers to compile the project easily from a network where they can't access Nexus, so the static informations about all the alternative repos used by Nexus (which should be a short list) should be enough IMO. – Tristan Dec 03 '18 at 16:22

0 Answers0