Skip to content

Commit

Permalink
Merge pull request #5 from charuwat/master
Browse files Browse the repository at this point in the history
Determine snapshot version from snapshotversion value directly
  • Loading branch information
hamnis authored Jan 24, 2017
2 parents b56514a + 838dd62 commit 0f59672
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions maven/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ def _find_latest_snapshot_version(self, artifact):
path = "/%s/maven-metadata.xml" % (artifact.path())

xml = self.requestor.request(self.base + path, self._onFail, lambda r: etree.parse(r))
timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/text()")[0]
buildNumber = xml.xpath("/metadata/versioning/snapshot/buildNumber/text()")[0]
return timestamp + "-" + buildNumber
snapshot_version = xml.xpath("/metadata/versioning/snapshotVersions/snapshotVersion/value/text()")[0]
return snapshot_version

def _onFail(self, url, e):
raise RequestException("Failed to download maven-metadata.xml from '%s'" % url)
Expand Down

0 comments on commit 0f59672

Please sign in to comment.