VersionRangeRequest (String groupId, String artifactId, VersionConstraint versioning, ArtifactKind artifactKind) { VersionRangeRequest request = new VersionRangeRequest(); for (Artifact artifact : toArtifacts(groupId, artifactId, Collections.singleton(versioning), EnumSet.of(artifactKind))) { request.setArtifact(artifact); // will be at most 1 artifact } List<RemoteRepository> repositories = new ArrayList<>(myRemoteRepositories.size()); for (RemoteRepository repository : myRemoteRepositories) { RepositoryPolicy policy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_WARN); repositories.add(new RemoteRepository.Builder(repository).setPolicy(policy).build()); } return request.setRepositories(repositories); }