Jenkins compares plugin versions using the following strategy:
- Each version number is split into segments separated by '-' and '.' characters.
- Starting with the first segment of each version number, segments are compared until a difference is encountered.
- If both segments are numeric, they are compared as numbers, otherwise they are compared as strings. There are a couple of special qualifier strings that get special treatment, for example if the string starts with 'a', 'b' or 'm' and the remainder of the string is a number, then those segments will be compared based as if the letter was replaced by 'alpha-', 'beta-' or 'milestone-' respectively. Also the qualifiers: 'snapshot'; 'alpha'; 'beta'; 'milestone'; 'rc' or 'cr'; '' or 'final' or 'ga'; and 'sp' will be sorted according to that sequence.
- Where the values of a segment are the same, if the preceding seperator was '.' then that comes before '-'.