mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
maven_artifact: fix download of SBT published snapshot artifact (#3085)
Fixes #1717
This commit is contained in:
parent
9efcfaff48
commit
39e3c530c0
1 changed files with 3 additions and 0 deletions
|
@ -222,6 +222,9 @@ class MavenDownloader:
|
||||||
xml = self._request(self.base + path, "Failed to download maven-metadata.xml", lambda r: etree.parse(r))
|
xml = self._request(self.base + path, "Failed to download maven-metadata.xml", lambda r: etree.parse(r))
|
||||||
timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/text()")[0]
|
timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/text()")[0]
|
||||||
buildNumber = xml.xpath("/metadata/versioning/snapshot/buildNumber/text()")[0]
|
buildNumber = xml.xpath("/metadata/versioning/snapshot/buildNumber/text()")[0]
|
||||||
|
for snapshotArtifact in xml.xpath("/metadata/versioning/snapshotVersions/snapshotVersion"):
|
||||||
|
if len(snapshotArtifact.xpath("classifier/text()")) > 0 and snapshotArtifact.xpath("classifier/text()")[0] == artifact.classifier and len(snapshotArtifact.xpath("extension/text()")) > 0 and snapshotArtifact.xpath("extension/text()")[0] == artifact.extension:
|
||||||
|
return self._uri_for_artifact(artifact, snapshotArtifact.xpath("value/text()")[0])
|
||||||
return self._uri_for_artifact(artifact, artifact.version.replace("SNAPSHOT", timestamp + "-" + buildNumber))
|
return self._uri_for_artifact(artifact, artifact.version.replace("SNAPSHOT", timestamp + "-" + buildNumber))
|
||||||
|
|
||||||
return self._uri_for_artifact(artifact, artifact.version)
|
return self._uri_for_artifact(artifact, artifact.version)
|
||||||
|
|
Loading…
Reference in a new issue