@Override protected boolean execute() throws Exception { // install the artifact try { ArtifactInstallFactory installFactory = artifactInstallFactoryProvider.get(); if (forceInstall()) installFactory.setForceInstall(true); if (localrepo != null) installFactory.setLocalRepository(localrepo); installFactory.setBeesClientConfiguration(getBeesClientBase().getBeesClientConfiguration()); GAV gav = new GAV(getArtifact()); if (pom != null && jar != null) { gav = installFactory.install(gav, jar, pom); } else gav = installFactory.install(gav); System.out.println("Plugin installed: " + gav); } catch (Exception e) { throw (IOException) new IOException("Failed to install " + getArtifact()).initCause(e); } return true; }
@Override public RemoteRepository decorate(RemoteRepository repo) { try { BeesClientConfiguration bcc = bees.get().getBeesClientConfiguration(); if (bcc==null) return repo; if (bcc.getProxyHost() != null && bcc.getProxyPort() > 0) { String proxyType = Proxy.TYPE_HTTP; if (repo.getUrl().startsWith("https")) proxyType = Proxy.TYPE_HTTPS; Proxy proxy = new Proxy(proxyType, bcc.getProxyHost(), bcc.getProxyPort(), null); if (bcc.getProxyUser() != null) { Authentication authentication = new Authentication(bcc.getProxyUser(), bcc.getProxyPassword()); proxy.setAuthentication(authentication); } repo.setProxy(proxy); } return repo; } catch (IOException e) { throw (Error)new Error("Failed to configure remote repository").initCause(e); } } }