當前位置: 首頁>>代碼示例>>Java>>正文


Java MavenSession.getSettings方法代碼示例

本文整理匯總了Java中org.apache.maven.execution.MavenSession.getSettings方法的典型用法代碼示例。如果您正苦於以下問題:Java MavenSession.getSettings方法的具體用法?Java MavenSession.getSettings怎麽用?Java MavenSession.getSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.execution.MavenSession的用法示例。


在下文中一共展示了MavenSession.getSettings方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getProxyConfig

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
static ProxyConfig getProxyConfig(MavenSession mavenSession) {
  if (
          mavenSession == null ||
                  mavenSession.getSettings() == null ||
                  mavenSession.getSettings().getActiveProxy() == null ||
                  !mavenSession.getSettings().getActiveProxy().isActive()
          ) {
    return null;
  } else {
    Proxy mavenProxy = mavenSession.getSettings().getActiveProxy();
    return new ProxyConfig(
            mavenProxy.getProtocol(),
            mavenProxy.getHost(),
            mavenProxy.getPort(),
            mavenProxy.getUsername(),
            mavenProxy.getPassword());
  }
}
 
開發者ID:RabbitStewDio,項目名稱:frontend-tomcat-maven-plugin,代碼行數:19,代碼來源:MojoUtils.java

示例2: getProxyConfig

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
static ProxyConfig getProxyConfig(MavenSession mavenSession, SettingsDecrypter decrypter) {
    if (mavenSession == null ||
            mavenSession.getSettings() == null ||
            mavenSession.getSettings().getProxies() == null ||
            mavenSession.getSettings().getProxies().isEmpty()) {
        return new ProxyConfig(Collections.<ProxyConfig.Proxy>emptyList());
    } else {
        final List<Proxy> mavenProxies = mavenSession.getSettings().getProxies();

        final List<ProxyConfig.Proxy> proxies = new ArrayList<ProxyConfig.Proxy>(mavenProxies.size());

        for (Proxy mavenProxy : mavenProxies) {
            if (mavenProxy.isActive()) {
                mavenProxy = decryptProxy(mavenProxy, decrypter);
                proxies.add(new ProxyConfig.Proxy(mavenProxy.getId(), mavenProxy.getProtocol(), mavenProxy.getHost(),
                        mavenProxy.getPort(), mavenProxy.getUsername(), mavenProxy.getPassword(), mavenProxy.getNonProxyHosts()));
            }
        }

        LOGGER.info("Found proxies: {}", proxies);
        return new ProxyConfig(proxies);
    }
}
 
開發者ID:eirslett,項目名稱:frontend-maven-plugin,代碼行數:24,代碼來源:MojoUtils.java

示例3: getProxyConfig

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
public static ProxyConfig getProxyConfig(MavenSession mavenSession, SettingsDecrypter decrypter) {
    if (mavenSession == null ||
            mavenSession.getSettings() == null ||
            mavenSession.getSettings().getProxies() == null ||
            mavenSession.getSettings().getProxies().isEmpty()) {
        return new ProxyConfig(Collections.<ProxyConfig.Proxy>emptyList());
    } else {
        final List<Proxy> mavenProxies = mavenSession.getSettings().getProxies();

        final List<ProxyConfig.Proxy> proxies = new ArrayList<>(mavenProxies.size());

        for (Proxy mavenProxy : mavenProxies) {
            if (mavenProxy.isActive()) {
                mavenProxy = decryptProxy(mavenProxy, decrypter);
                proxies.add(new ProxyConfig.Proxy(mavenProxy.getId(), mavenProxy.getProtocol(), mavenProxy.getHost(),
                        mavenProxy.getPort(), mavenProxy.getUsername(), mavenProxy.getPassword(), mavenProxy.getNonProxyHosts()));
            }
        }

        return new ProxyConfig(proxies);
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:23,代碼來源:MojoUtils.java

示例4: getServerSettings

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
public Server getServerSettings(String serverId) {
	MavenSession mavenSession = getMavenSession();
	Settings settings = mavenSession.getSettings();
	Server server = settings.getServer(serverId);
	return server;
}
 
開發者ID:link-intersystems,項目名稱:maven,代碼行數:7,代碼來源:AbstractMavenContextMojo.java


注:本文中的org.apache.maven.execution.MavenSession.getSettings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。