result.setRepository(latest.repository);
result.setVersion(latest.version.toString());
}
if (latest != null && latest.version.toString().endsWith(SNAPSHOT)) {
VersionRequest subRequest = new VersionRequest();
subRequest.setArtifact(artifact.setVersion(result.getVersion()));
if (result.getRepository() instanceof RemoteRepository) {
subRequest.setRepositories(Collections.singletonList((RemoteRepository) result.getRepository()));
} else {
subRequest.setRepositories(request.getRepositories());
}
VersionResult subResult = resolveVersion(session, subRequest);
result.setVersion(subResult.getVersion());
result.setRepository(subResult.getRepository());
for (Exception exception : subResult.getExceptions()) {