当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationBuilder.addPassword方法代码示例

本文整理汇总了Java中org.eclipse.aether.util.repository.AuthenticationBuilder.addPassword方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationBuilder.addPassword方法的具体用法?Java AuthenticationBuilder.addPassword怎么用?Java AuthenticationBuilder.addPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.aether.util.repository.AuthenticationBuilder的用法示例。


在下文中一共展示了AuthenticationBuilder.addPassword方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractAuth

import org.eclipse.aether.util.repository.AuthenticationBuilder; //导入方法依赖的package包/类
private static Authentication extractAuth(final URL url) {
  String userInfo = url.getUserInfo();
  if (userInfo != null) {
    AuthenticationBuilder authBuilder = new AuthenticationBuilder();
    int sep = userInfo.indexOf(':');
    if (sep != -1) {
      authBuilder.addUsername(userInfo.substring(0, sep));
      authBuilder.addPassword(userInfo.substring(sep + 1));
    }
    else {
      authBuilder.addUsername(userInfo);
    }
    return authBuilder.build();
  }
  return null;
}
 
开发者ID:cstamas,项目名称:vertx-sisu,代码行数:17,代码来源:AetherResolver.java

示例2: testMvn1

import org.eclipse.aether.util.repository.AuthenticationBuilder; //导入方法依赖的package包/类
@Test
public void testMvn1 () throws Exception
{
    final ChannelTester ct = ChannelTester.create ( getWebContext (), "m1" );
    ct.addAspect ( "mvn" );
    ct.addAspect ( "maven.repo" );
    ct.assignDeployGroup ( "m1" );

    final String key = ct.getDeployKeys ().iterator ().next (); // get first

    assertNotNull ( key );

    final RepositorySystem system = MavenUtil.newRepositorySystem ();
    final RepositorySystemSession session = MavenUtil.newRepositorySystemSession ( system );

    Artifact jarArtifact = new DefaultArtifact ( "org.eclipse.packagedrone.testing", "test.felix1", "", "jar", "0.0.1-SNAPSHOT" );
    jarArtifact = jarArtifact.setFile ( new File ( TEST_1_JAR ) );

    Artifact pomArtifact = new SubArtifact ( jarArtifact, "", "pom" );
    pomArtifact = pomArtifact.setFile ( new File ( TEST_1_POM ) );

    Artifact srcArtifact = new SubArtifact ( jarArtifact, "sources", "jar" );
    srcArtifact = srcArtifact.setFile ( new File ( TEST_1_SOURCES_JAR ) );

    final AuthenticationBuilder ab = new AuthenticationBuilder ();
    ab.addUsername ( "deploy" );
    ab.addPassword ( key );
    final Authentication auth = ab.build ();
    final RemoteRepository distRepo = new RemoteRepository.Builder ( "test", "default", resolve ( String.format ( "/maven/%s", ct.getId () ) ) ).setAuthentication ( auth ).build ();

    final DeployRequest deployRequest = new DeployRequest ();
    deployRequest.addArtifact ( jarArtifact ).addArtifact ( pomArtifact ).addArtifact ( srcArtifact );
    deployRequest.setRepository ( distRepo );

    system.deploy ( session, deployRequest );

    testUrl ( String.format ( "/maven/%s", ct.getId () ) ); // index page

    // FIXME: check more data
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:41,代码来源:MavenTest.java

示例3: extractAuth

import org.eclipse.aether.util.repository.AuthenticationBuilder; //导入方法依赖的package包/类
private static Authentication extractAuth(URL url) {
  String userInfo = url.getUserInfo();
  if (userInfo != null) {
    AuthenticationBuilder authBuilder = new AuthenticationBuilder();
    int sep = userInfo.indexOf(':');
    if (sep != -1) {
      authBuilder.addUsername(userInfo.substring(0, sep));
      authBuilder.addPassword(userInfo.substring(sep + 1));
    } else {
      authBuilder.addUsername(userInfo);
    }
    return authBuilder.build();
  }
  return null;
}
 
开发者ID:vert-x3,项目名称:vertx-stack,代码行数:16,代码来源:ResolverImpl.java

示例4: testMvn1

import org.eclipse.aether.util.repository.AuthenticationBuilder; //导入方法依赖的package包/类
@Test
public void testMvn1 () throws Exception
{
    final ChannelTester ct = ChannelTester.create ( getWebContext (), "m1" );
    ct.addAspect ( "mvn" );
    ct.addAspect ( "maven.repo" );
    ct.assignDeployGroup ( "m1" );

    final String key = ct.getDeployKeys ().iterator ().next (); // get first

    assertNotNull ( key );

    final RepositorySystem system = MavenUtil.newRepositorySystem ();
    final RepositorySystemSession session = MavenUtil.newRepositorySystemSession ( system );

    Artifact jarArtifact = new DefaultArtifact ( "de.dentrassi", "test.bundle1", "", "jar", "1.0.0-SNAPSHOT" );
    jarArtifact = jarArtifact.setFile ( new File ( "data/mvn/test.bundle1-1.0.0-SNAPSHOT.jar" ) );

    Artifact pomArtifact = new SubArtifact ( jarArtifact, "", "pom" );
    pomArtifact = pomArtifact.setFile ( new File ( "data/mvn/test.bundle1-1.0.0-SNAPSHOT.pom" ) );

    Artifact srcArtifact = new SubArtifact ( jarArtifact, "sources", "jar" );
    srcArtifact = srcArtifact.setFile ( new File ( "data/mvn/test.bundle1-1.0.0-SNAPSHOT-sources.jar" ) );

    final AuthenticationBuilder ab = new AuthenticationBuilder ();
    ab.addUsername ( "deploy" );
    ab.addPassword ( key );
    final Authentication auth = ab.build ();
    final RemoteRepository distRepo = new RemoteRepository.Builder ( "test", "default", resolve ( String.format ( "/maven/%s", ct.getId () ) ) ).setAuthentication ( auth ).build ();

    final DeployRequest deployRequest = new DeployRequest ();
    deployRequest.addArtifact ( jarArtifact ).addArtifact ( pomArtifact ).addArtifact ( srcArtifact );
    deployRequest.setRepository ( distRepo );

    system.deploy ( session, deployRequest );

    testUrl ( String.format ( "/maven/%s", ct.getId () ) ); // index page

    // FIXME: check more data
}
 
开发者ID:ctron,项目名称:package-drone,代码行数:41,代码来源:MavenTest.java


注:本文中的org.eclipse.aether.util.repository.AuthenticationBuilder.addPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。