public static boolean isVersionNewerThan(String oneVersion,String otherVersion){
  if (oneVersion == null || otherVersion == null) {
    return false;
  }
  if (otherVersion.equals(oneVersion + "-SNAPSHOT")) {
    return true;
  }
  if (oneVersion.equals(otherVersion + "-SNAPSHOT")) {
    return false;
  }
  return oneVersion.compareTo(otherVersion) > 0;
}

public static boolean isVersionNewerThan ( String oneVersion , String otherVersion ) { if ( oneVersion == null || otherVersion == null ) { return false ; } if ( otherVersion . equals ( oneVersion + "-SNAPSHOT" ) ) { return true ; } if ( oneVersion . equals ( otherVersion + "-SNAPSHOT" ) ) { return false ; } return oneVersion . compareTo ( otherVersion ) > 0 ; }
determine whether oneversion is newer than otherversion . this performs a lexicographic comparison with the exception that a version with suffix " - snapshot " is treated as older than the version without that suffix . a version is not newer than itself .
