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)
Adds support for snapshot libraries (i.e. libraries with the version ending in
-SNAPSHOT
).The approach taken by this PR modifies
resolveLibrary
to fetch themaven-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 intodownloadLibrary(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 callingnext()
, essentially leavingdownloadLibrary(Library)
mostly untouched, but that'd be a breaking change sinceresolveLibrary
is public)Fixes #15