Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for snapshot libraries #20

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Conversation

frengor
Copy link
Collaborator

@frengor frengor commented Aug 2, 2023

Adds support for snapshot libraries (i.e. libraries with the version ending in -SNAPSHOT).
The approach taken by this PR modifies resolveLibrary to fetch the maven-metadata.xml file from every repository (when the passed library is a snapshot) to determine the last-published artifact download url.

An issue with this approach is that if more than one repository is declared, then unnecessary downloads of the metadata files may happen, since they are all fetched before trying to download the artifacts. It would be better to try to download each artifact right after fetching each metadata file and to stop after the first successful download. This however requires inlining the resolveLibrary method into downloadLibrary(Library). I preferred not doing so in this PR and leaving it as a future improvement.
(Another way could be to make resolveLibrary return a lazy iterator which fetches the metadata file only when calling next(), essentially leaving downloadLibrary(Library) mostly untouched, but that'd be a breaking change since resolveLibrary is public)

Fixes #15

@AlessioDP AlessioDP merged commit 8131639 into AlessioDP:master Aug 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not find dependencies in repository in version folder if subversions are present
2 participants