public static int compareVersions(String v1, String v2) {
		// Remove the SNAPSHOT version.
		//final String fixedv1 = v1.replaceFirst("-SNAPSHOT$", ""); //$NON-NLS-1$ //$NON-NLS-2$
		//final String fixedv2 = v2.replaceFirst("-SNAPSHOT$", ""); //$NON-NLS-1$ //$NON-NLS-2$
		//final Version vobject1 = Version.parseVersion(fixedv1);
		//final Version vobject2 = Version.parseVersion(fixedv2);
		final Version vobject1 = Version.parseVersion(v1);
		final Version vobject2 = Version.parseVersion(v2);
		return vobject1.compareTo(vobject2);
	}
public static int compareVersions ( String v1 , String v2 ) { final Version vobject1 = Version . parseVersion ( v1 ) ; final Version vobject2 = Version . parseVersion ( v2 ) ; return vobject1 . compareTo ( vobject2 ) ; }
Compare the two strings as they are version numbers.

@param v1 - first version to compare.
@param v2 - second version to compare.
@return Negative integer of <code>v1</code> is lower than <code>v2</code>;
positive integer of <code>v1</code> is greater than <code>v2</code>;
{@code 0} if they are strictly equal.