Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting sonatype nexus3 as maven server backend? #18

Open
morco opened this issue Feb 22, 2022 · 3 comments
Open

Supporting sonatype nexus3 as maven server backend? #18

morco opened this issue Feb 22, 2022 · 3 comments

Comments

@morco
Copy link

morco commented Feb 22, 2022

Good day,

I recently discovered this project and liked it immediately. Unfortunately it does not quite work for me atm. I'm currently mainly interested in discovering which versions are available on a maven repo server, so the client method: find_artifacts.
We are using a privately hosted nexus3 as maven server. Searching for versions on the server with gid and aid as coordinate (e.g.: "de.sma.tools:genupd") unfortunately always returns empty although versions do exists.

The problem seems to be that current implementation of repo.get_versions method which is internally called by find_artifacts checks at first if the artifact query path exists on server, which basically means doing a http request to <server-repo-url>/<gid>/<aid> and checking if the server returns a 2XX code.

But this URL seems to be never valid for nexus hosted maven repos:

nexus_maven_path01

It actually seems that the only direct paths accessible from nexus servers are the complete path for a maven artifact (obviously):

nexus_maven_path03b

And the path for the maven artifact metadata (which is used by the listdir method):

nexus_maven_path02

This might be technically a violation of the maven standard on nexus side, but it would imho still be possible to support nexus in pymaven without compromising existing functionality (much).
If for example the path existence test would be omitted at the start of repo.get_versions and listdir method would return an empty list instead of failing on http error it would work for nexus (tested that) and should also not greatly change behavior for already supported use cases I think.

What would your project stance be on this matter? If you're interested I would be willing to write a proper PR for this.

@danieljmv01
Copy link

Hi! As @morco, I would be interested in interacting with a privately hosted nexus3 too.

I use requests and the Nexus3 REST API to interact with it, but I would rather use this library if it supported this.

I haven't look the code in detail yet, but I think that this should be doable without impacting the existing functionality at all. This library already uses polymorphism for repositories, so we maybe we could add a new subclass for a nexus maven repo (or maybe a client, I would have to study the code to tell).

So, is this something that you would like to support in this library or would it be out of its scope?

Thanks!

PD: As @morco, I would like to contribute, do you have a contributing guide? All I found is the contributor agreement.

@morco
Copy link
Author

morco commented Mar 7, 2022

@danieljmv01: I have created a branch in my fork which works for me for now. So if installing from source repo is workable in your environment as a temporary solution feel free to try it.

@wfscheper
Copy link
Contributor

@morco or @danieljmv01,

Thanks for your interest in pymaven! Work on pymaven was recently restarted. If either of you are still interested in contributing, please reach out to me either in this issue or via a PR. I plan to do some modernization of the project soon, and adding a contribution guide is on my todo list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants