mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
f93515adb9
commit
f92ae0831b
1 changed files with 5 additions and 6 deletions
|
@ -166,7 +166,7 @@ from ansible.module_utils.urls import fetch_url
|
|||
|
||||
|
||||
class Artifact(object):
|
||||
def __init__(self, group_id, artifact_id, version, classifier=None, extension='jar'):
|
||||
def __init__(self, group_id, artifact_id, version, classifier='', extension='jar'):
|
||||
if not group_id:
|
||||
raise ValueError("group_id must be set")
|
||||
if not artifact_id:
|
||||
|
@ -261,10 +261,9 @@ class MavenDownloader:
|
|||
timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/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):
|
||||
artifact_classifier = snapshotArtifact.xpath("classifier/text()")[0] if len(snapshotArtifact.xpath("classifier/text()")) > 0 else ''
|
||||
artifact_extension = snapshotArtifact.xpath("extension/text()")[0] if len(snapshotArtifact.xpath("extension/text()")) > 0 else ''
|
||||
if artifact_classifier == artifact.classifier and artifact_extension == 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))
|
||||
|
||||
|
@ -375,7 +374,7 @@ def main():
|
|||
group_id = dict(default=None),
|
||||
artifact_id = dict(default=None),
|
||||
version = dict(default="latest"),
|
||||
classifier = dict(default=None),
|
||||
classifier = dict(default=''),
|
||||
extension = dict(default='jar'),
|
||||
repository_url = dict(default=None),
|
||||
username = dict(default=None,aliases=['aws_secret_key']),
|
||||
|
|
Loading…
Reference in a new issue