org.eclipse.aether.repository.Proxy.getType()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中org.eclipse.aether.repository.Proxy.getType()方法的一些代码示例,展示了Proxy.getType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Proxy.getType()方法的具体详情如下:
包路径:org.eclipse.aether.repository.Proxy
类名称:Proxy
方法名:getType

Proxy.getType介绍

[英]Gets the type of this proxy.
[中]获取此代理的类型。

代码示例

代码示例来源:origin: apache/maven

p.setProtocol( proxy.getType() );
p.setPort( proxy.getPort() );
if ( proxy.getAuthentication() != null )

代码示例来源:origin: apache/maven

p.setProtocol( proxy.getType() );
p.setPort( proxy.getPort() );
if ( proxy.getAuthentication() != null )

代码示例来源:origin: org.jboss.galleon/galleon-cli

@Override
  public Proxy getProxy(RemoteRepository repo) {
    Proxy ret = null;
    if (proxy.getType().equals(repo.getProtocol())) {
      boolean match = false;
      for (Pattern p : nonProxyHosts) {
        if (p.matcher(repo.getHost()).matches()) {
          match = true;
          break;
        }
      }
      if (!match) {
        ret = proxy;
      }
    }
    return ret;
  }
}

代码示例来源:origin: org.eclipse.aether/aether-util

String key = proxy.proxy.getType().toLowerCase( Locale.ENGLISH );
if ( !candidates.containsKey( key ) )

代码示例来源:origin: org.apache.maven.resolver/maven-resolver-util

String key = proxy.proxy.getType().toLowerCase( Locale.ENGLISH );
if ( !candidates.containsKey( key ) )

代码示例来源:origin: org.eclipse.aether/aether-transport-wagon

prox.setType( p.getType() );
prox.setHost( p.getHost() );
prox.setPort( p.getPort() );

代码示例来源:origin: org.eclipse.aether/aether-connector-wagon

prox.setType( p.getType() );
prox.setHost( p.getHost() );
prox.setPort( p.getPort() );

代码示例来源:origin: org.kie.soup/kie-soup-maven-integration

@Test
public void testProxies() {
  String oldSettingsXmlPath = System.getProperty( CUSTOM_SETTINGS_PROPERTY );
  try {
    if (oldSettingsXmlPath != null) {
      System.clearProperty( CUSTOM_SETTINGS_PROPERTY );
    }
    MavenSettings.reinitSettingsFromString( SETTINGS_WITH_PROXY );
    Aether aether = Aether.getAether();
    RemoteRepository remoteRepository = new RemoteRepository.Builder( "local", "default", "http://myserver.com" ).build();
    Proxy proxy = aether.getSession().getProxySelector().getProxy( remoteRepository );
    assertEquals("http", proxy.getType());
    assertEquals("localhost", proxy.getHost());
    assertEquals(8888, proxy.getPort());
  } finally {
    if (oldSettingsXmlPath != null) {
      System.setProperty( CUSTOM_SETTINGS_PROPERTY, oldSettingsXmlPath );
    }
    MavenSettings.reinitSettings();
  }
}

代码示例来源:origin: org.springframework.boot.experimental/spring-boot-thin-launcher

private org.apache.maven.repository.Proxy proxy(MavenSettings settings,
    RepositorySystemSession session, RemoteRepository remote,
    ProxySelector proxy) {
  Proxy config = proxy.getProxy(remote);
  if (config == null) {
    return null;
  }
  org.apache.maven.repository.Proxy result = new org.apache.maven.repository.Proxy();
  result.setHost(config.getHost());
  if (config.getAuthentication() != null) {
    org.apache.maven.artifact.repository.Authentication auth = authentication(
        settings, session,
        new RemoteRepository.Builder(remote)
            .setAuthentication(config.getAuthentication()).build(),
        config.getAuthentication());
    result.setUserName(auth.getUsername());
    result.setPassword(auth.getPassword() != null ? auth.getPassword()
        : auth.getPassphrase());
  }
  result.setProtocol(config.getType());
  result.setPort(config.getPort());
  return result;
}

相关文章