RemoteRepository (String id, String url, ArtifactAuthenticationData authenticationData, boolean allowSnapshots) { // for maven repos repository type should be 'default' RemoteRepository.Builder builder = new RemoteRepository.Builder(id, "default", url); if (!allowSnapshots) { builder.setSnapshotPolicy(new RepositoryPolicy(false, null, null)); } if (authenticationData != null) { AuthenticationBuilder authenticationBuilder = new AuthenticationBuilder(); authenticationBuilder.addUsername(authenticationData.getUsername()); authenticationBuilder.addPassword(authenticationData.getPassword()); builder.setAuthentication(authenticationBuilder.build()); } return builder.setProxy(ourProxySelector.getProxy(url)).build(); }