Skip to content

Commit 5727960

Browse files
authored
Merge pull request #37 from hamnis/resolve-latest-snapshot
Allow snapshot to be resolved from latest
2 parents 14d2ad5 + 32edadb commit 5727960

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/maven_artifact/resolver.py

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ def resolve(self, artifact):
4444
version = self._find_latest_version_available(artifact)
4545
elif artifact.is_snapshot():
4646
version = self._find_latest_snapshot_version(artifact)
47+
48+
resolved_artifact = artifact.with_version(version)
49+
if resolved_artifact.is_snapshot():
50+
# We need to re-resolve the snapshot version to get the actual version
51+
resolved_version = self._find_latest_snapshot_version(resolved_artifact)
52+
return resolved_artifact.with_resolved_version(resolved_version)
4753
return artifact.with_resolved_version(version)
4854

4955
def uri_for_artifact(self, artifact):

0 commit comments

Comments
 (0)