It is possible that people use [LTS releases](http://mirrors.jenkins-ci.org/war-stable/) of Jenkins. The recent LTS release for Jenkins is `1.509.4`. In this case this can't match the version correctly. So a patch version should be added to this logic along with major and minor.