use of org.eclipse.aether.repository.RemoteRepository in project storm by apache.
the class DependencyResolver method applyProxy.
private void applyProxy() {
List<RemoteRepository> appliedRepositories = new ArrayList<>(remoteRepositories.size());
for (RemoteRepository repository : remoteRepositories) {
appliedRepositories.add(new RemoteRepository.Builder(repository).setProxy(proxy).build());
}
this.remoteRepositories = appliedRepositories;
}
use of org.eclipse.aether.repository.RemoteRepository in project pinpoint by naver.
the class DependencyResolver method newRepositories.
static List<RemoteRepository> newRepositories(String... urls) {
List<RemoteRepository> repositories = new ArrayList<>(urls.length + 1);
RemoteRepository mavenCentralRepository = newMavenCentralRepository();
repositories.add(mavenCentralRepository);
int localRepositoriesCount = 0;
for (String url : urls) {
RemoteRepository remoteRepository = new RemoteRepository.Builder("local" + localRepositoriesCount, "default", url).build();
repositories.add(remoteRepository);
}
return repositories;
}
use of org.eclipse.aether.repository.RemoteRepository in project zeppelin by apache.
the class InterpreterSettingManager method loadFromFile.
/**
* Load interpreter setting from interpreter.json
*/
private void loadFromFile() throws IOException {
InterpreterInfoSaving infoSaving = configStorage.loadInterpreterSettings();
if (infoSaving == null) {
// setting from interpreterSettingTemplates
for (InterpreterSetting interpreterSettingTemplate : interpreterSettingTemplates.values()) {
InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate);
initInterpreterSetting(interpreterSetting);
if (shouldRegister(interpreterSetting.getGroup())) {
addInterpreterSetting(interpreterSetting);
}
}
return;
}
// TODO(zjffdu) still ugly (should move all to InterpreterInfoSaving)
for (InterpreterSetting savedInterpreterSetting : infoSaving.interpreterSettings.values()) {
if (!shouldRegister(savedInterpreterSetting.getGroup())) {
continue;
}
savedInterpreterSetting.setProperties(InterpreterSetting.convertInterpreterProperties(savedInterpreterSetting.getProperties()));
initInterpreterSetting(savedInterpreterSetting);
InterpreterSetting interpreterSettingTemplate = interpreterSettingTemplates.get(savedInterpreterSetting.getGroup());
// the user saved interpreter setting
if (interpreterSettingTemplate != null) {
savedInterpreterSetting.sortPropertiesByTemplate(interpreterSettingTemplate.getProperties());
savedInterpreterSetting.fillPropertyDescription(interpreterSettingTemplate.getProperties());
// merge InterpreterDir, InterpreterInfo & InterpreterRunner
savedInterpreterSetting.setInterpreterDir(interpreterSettingTemplate.getInterpreterDir());
savedInterpreterSetting.setInterpreterInfos(interpreterSettingTemplate.getInterpreterInfos());
savedInterpreterSetting.setInterpreterRunner(interpreterSettingTemplate.getInterpreterRunner());
} else {
LOGGER.warn("No InterpreterSetting Template found for InterpreterSetting: {}," + " but it is found in interpreter.json, it would be skipped.", savedInterpreterSetting.getGroup());
continue;
}
// remove it first
for (InterpreterSetting setting : interpreterSettings.values()) {
if (setting.getName().equals(savedInterpreterSetting.getName())) {
removeInterpreterSetting(setting.getId());
}
}
savedInterpreterSetting.postProcessing();
LOGGER.info("Create interpreter setting {} from interpreter.json", savedInterpreterSetting.getName());
addInterpreterSetting(savedInterpreterSetting);
}
for (InterpreterSetting interpreterSettingTemplate : interpreterSettingTemplates.values()) {
InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate);
initInterpreterSetting(interpreterSetting);
// add newly detected interpreter if it doesn't exist in interpreter.json
if (!interpreterSettings.containsKey(interpreterSetting.getId())) {
LOGGER.info("Create interpreter setting: {} from interpreter setting template", interpreterSetting.getId());
addInterpreterSetting(interpreterSetting);
}
}
if (infoSaving.interpreterRepositories != null) {
for (RemoteRepository repo : infoSaving.interpreterRepositories) {
if (!dependencyResolver.getRepos().contains(repo)) {
this.interpreterRepositories.add(repo);
}
}
// repositories have been loaded.
for (InterpreterSetting setting : interpreterSettings.values()) {
setting.setDependencies(setting.getDependencies());
}
}
}
use of org.eclipse.aether.repository.RemoteRepository in project druid by druid-io.
the class PullDependencies method createTeslaAether.
private DefaultTeslaAether createTeslaAether(List<Repository> remoteRepositories) {
if (!useProxy) {
return new DefaultTeslaAether(localRepository, remoteRepositories.toArray(new Repository[0]));
}
if (!StringUtils.toLowerCase(proxyType).equals(Proxy.TYPE_HTTP) && !StringUtils.toLowerCase(proxyType).equals(Proxy.TYPE_HTTPS)) {
throw new IllegalArgumentException("invalid proxy type: " + proxyType);
}
RepositorySystemSession repositorySystemSession = new RepositorySystemSessionProvider(new File(localRepository)).get();
List<RemoteRepository> rl = remoteRepositories.stream().map(r -> {
RemoteRepository.Builder builder = new RemoteRepository.Builder(r.getId(), "default", r.getUrl());
if (r.getUsername() != null && r.getPassword() != null) {
Authentication auth = new AuthenticationBuilder().addUsername(r.getUsername()).addPassword(r.getPassword()).build();
builder.setAuthentication(auth);
}
final Authentication proxyAuth;
if (Strings.isNullOrEmpty(proxyUsername)) {
proxyAuth = null;
} else {
proxyAuth = new AuthenticationBuilder().addUsername(proxyUsername).addPassword(proxyPassword).build();
}
builder.setProxy(new Proxy(proxyType, proxyHost, proxyPort, proxyAuth));
return builder.build();
}).collect(Collectors.toList());
return new DefaultTeslaAether(rl, repositorySystemSession);
}
use of org.eclipse.aether.repository.RemoteRepository in project spring-boot by spring-projects.
the class MavenResolverGrapeEngineTests method repositoryAuthentication.
@Test
void repositoryAuthentication() {
doWithCustomUserHome(() -> {
List<RemoteRepository> repositories = getRepositories();
assertThat(repositories).hasSize(1);
Authentication authentication = repositories.get(0).getAuthentication();
assertThat(authentication).isNotNull();
});
}
Aggregations