private Artifact getLatestVersion0(String coords, String type) {
try {
final Artifact artifact = coordsToArtifact(coords, type);
final String version;
if (isVersionRange(artifact.getVersion())) {
final VersionRangeRequest request = new VersionRangeRequest().setRepositories(repos).setArtifact(artifact);
final VersionRangeResult result = system.resolveVersionRange(session, request);
final Version highestVersion = result.getHighestVersion();
version = highestVersion != null ? highestVersion.toString() : null;
} else {
final VersionRequest request = new VersionRequest().setRepositories(repos).setArtifact(artifact);