{"action":"opened","issue":{"url":"https://api.github.com/repos/aresok/go-maven-poller/issues/3","labels_url":"https://api.github.com/repos/aresok/go-maven-poller/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/aresok/go-maven-poller/issues/3/comments","events_url":"https://api.github.com/repos/aresok/go-maven-poller/issues/3/events","html_url":"https://github.com/aresok/go-maven-poller/issues/3","id":55955028,"number":3,"title":"Latest snapshot is not used","user":{"login":"jefftrimm","id":6233457,"avatar_url":"https://avatars.githubusercontent.com/u/6233457?v=3","gravatar_id":"","url":"https://api.github.com/users/jefftrimm","html_url":"https://github.com/jefftrimm","followers_url":"https://api.github.com/users/jefftrimm/followers","following_url":"https://api.github.com/users/jefftrimm/following{/other_user}","gists_url":"https://api.github.com/users/jefftrimm/gists{/gist_id}","starred_url":"https://api.github.com/users/jefftrimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefftrimm/subscriptions","organizations_url":"https://api.github.com/users/jefftrimm/orgs","repos_url":"https://api.github.com/users/jefftrimm/repos","events_url":"https://api.github.com/users/jefftrimm/events{/privacy}","received_events_url":"https://api.github.com/users/jefftrimm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-29T20:52:22Z","updated_at":"2015-01-29T20:52:22Z","closed_at":null,"body":"copied this from Thoughtworks GitHub, as I just ran into this issue:\r\n\r\nWhen the poller identifies that a snapshot is the latest version, it can incorrectly pull the wrong version of the snapshot.\r\n\r\nLooks like in:\r\ncom.tw.go.plugin.maven.client.RepositoryClient \r\nMethod : Files getFiles(MavenVersion version)\r\n\r\nIt assumes that the first result is the correct one... off the files list it just pulls element 0 -> files.get(0)\r\n\r\nFor snapshots versions the nexus response can contain multiple files and it does not appear to be safe to assume that the latest version will be the first one listed (element 0). The lastModified element of the nexus response should be considered or the internal identifier can be parsed from the artifact name:\r\nfor instance version some-jar-1.0-SNAPSHOT in the response the actual artifact is like: \r\nsome-jar-1.0-20131010-548425-3.jar which could be parsed to determine the correct latest version.\r\n\r\nThis is similar to Issue #3, but that issue results in the poller not seeing that a new snapshot version is available. This issue causes is when it sees that it does have a new snapshot, but picks the wrong one to send through the pipeline."}}