use of org.apache.maven.artifact.manager.WagonManager in project intellij-community by JetBrains.
the class Maven2ServerEmbedderImpl method setConsoleAndIndicator.
private void setConsoleAndIndicator(MavenServerConsole console, MavenServerProgressIndicator indicator) {
myConsoleWrapper.setWrappee(console);
myCurrentIndicator = indicator;
WagonManager wagon = getComponent(WagonManager.class);
wagon.setDownloadMonitor(indicator == null ? null : new TransferListenerAdapter(indicator));
}
use of org.apache.maven.artifact.manager.WagonManager in project intellij-community by JetBrains.
the class MavenEmbedder method loadSettings.
private void loadSettings() {
// copied from DefaultMaven.resolveParameters
// copied because using original code spoils something in the container and configuration are get messed and not picked up.
WagonManager wagonManager = getComponent(WagonManager.class);
wagonManager.setOnline(!mySettings.isOffline());
if (wagonManager instanceof DefaultWagonManager) {
((DefaultWagonManager) wagonManager).setHttpUserAgent("Apache-Maven/2.2");
}
Proxy proxy = mySettings.getActiveProxy();
if (proxy != null && proxy.getHost() != null) {
String pass = decrypt(proxy.getPassword());
wagonManager.addProxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(), pass, proxy.getNonProxyHosts());
}
for (Object each : mySettings.getServers()) {
Server server = (Server) each;
String passWord = decrypt(server.getPassword());
String passPhrase = decrypt(server.getPassphrase());
wagonManager.addAuthenticationInfo(server.getId(), server.getUsername(), passWord, server.getPrivateKey(), passPhrase);
wagonManager.addPermissionInfo(server.getId(), server.getFilePermissions(), server.getDirectoryPermissions());
if (server.getConfiguration() != null) {
wagonManager.addConfiguration(server.getId(), (Xpp3Dom) server.getConfiguration());
}
}
for (Object each : mySettings.getMirrors()) {
Mirror mirror = (Mirror) each;
if (mirror.getUrl() == null)
continue;
wagonManager.addMirror(mirror.getId(), mirror.getMirrorOf(), mirror.getUrl());
}
// end copied from DefaultMaven.resolveParameters
}
Aggregations