diff --git a/swh/loader/package/maven/loader.py b/swh/loader/package/maven/loader.py --- a/swh/loader/package/maven/loader.py +++ b/swh/loader/package/maven/loader.py @@ -150,8 +150,8 @@ return list(self.version_artifact) def get_default_version(self) -> str: - # Default version is the last item - return self.artifacts[-1]["version"] + # Default version is the one of the most recent artifact + return list(sorted(self.artifacts, key=lambda a: a["time"]))[-1]["version"] def get_metadata_authority(self): return MetadataAuthority(type=MetadataAuthorityType.FORGE, url=self.base_url)