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


Java RemoteRepository.Builder方法代码示例

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


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

示例1: toRemoteRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public static RemoteRepository toRemoteRepository(
    String repoUrl, Optional<String> username, Optional<String> password) {
  RemoteRepository.Builder repo =
      new RemoteRepository.Builder(null, "default", repoUrl)
          .setPolicy(new RepositoryPolicy(true, null, CHECKSUM_POLICY_FAIL));

  if (username.isPresent() && password.isPresent()) {
    Authentication authentication =
        new AuthenticationBuilder()
            .addUsername(username.get())
            .addPassword(password.get())
            .build();
    repo.setAuthentication(authentication);
  }

  return repo.build();
}
 
开发者ID:facebook,项目名称:buck,代码行数:18,代码来源:AetherUtil.java

示例2: readRemoteRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private static RemoteRepository readRemoteRepository(String id, ConfigurationSection config) {
    String url = config.getString("url");
    RemoteRepository.Builder builder = new RemoteRepository.Builder(id, "default", url);

    ConfigurationSection authConfig = config.getConfigurationSection("authentication");
    if (authConfig != null)
        builder = builder.setAuthentication(readAuthentication(authConfig));

    ConfigurationSection releasePolicyConfig = config.getConfigurationSection("release_policy");
    if (releasePolicyConfig != null)
        builder = builder.setReleasePolicy(readRepositoryPolicy(releasePolicyConfig));

    ConfigurationSection snapshotPolicyConfig = config.getConfigurationSection("snapshot_policy");
    if (snapshotPolicyConfig != null)
        builder = builder.setSnapshotPolicy(readRepositoryPolicy(snapshotPolicyConfig));

    return builder.build();
}
 
开发者ID:MCCityVille,项目名称:libmanager,代码行数:19,代码来源:Config.java

示例3: readRemoteRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private static RemoteRepository readRemoteRepository(String id, Configuration config) {
    String url = config.getString("url");
    RemoteRepository.Builder builder = new RemoteRepository.Builder(id, "default", url);

    Configuration authConfig = (Configuration) config.get("authentication");
    if (authConfig != null)
        builder = builder.setAuthentication(readAuthentication(authConfig));

    Configuration releasePolicyConfig = (Configuration) config.get("release_policy");
    if (releasePolicyConfig != null)
        builder = builder.setReleasePolicy(readRepositoryPolicy(releasePolicyConfig));

    Configuration snapshotPolicyConfig = (Configuration) config.get("snapshot_policy");
    if (snapshotPolicyConfig != null)
        builder = builder.setSnapshotPolicy(readRepositoryPolicy(snapshotPolicyConfig));

    return builder.build();
}
 
开发者ID:MCCityVille,项目名称:libmanager,代码行数:19,代码来源:Config.java

示例4: createRepositories

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private static List<RemoteRepository> createRepositories(
		List<RepositoryConfiguration> repositoryConfigurations) {
	List<RemoteRepository> repositories = new ArrayList<RemoteRepository>(
			repositoryConfigurations.size());
	for (RepositoryConfiguration repositoryConfiguration : repositoryConfigurations) {
		RemoteRepository.Builder builder = new RemoteRepository.Builder(
				repositoryConfiguration.getName(), "default",
				repositoryConfiguration.getUri().toASCIIString());

		if (!repositoryConfiguration.getSnapshotsEnabled()) {
			builder.setSnapshotPolicy(
					new RepositoryPolicy(false, RepositoryPolicy.UPDATE_POLICY_NEVER,
							RepositoryPolicy.CHECKSUM_POLICY_IGNORE));
		}
		repositories.add(builder.build());
	}
	return repositories;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:AetherGrapeEngineFactory.java

示例5: getRemoteRepoFromDeployment

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository repo,
                                                     final MavenEmbedder embedder) {
    RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(repo.getId(),
                                                                              repo.getLayout(),
                                                                              repo
                                                                                      .getUrl())
            .setSnapshotPolicy(new RepositoryPolicy(true,
                                                    RepositoryPolicy.UPDATE_POLICY_DAILY,
                                                    RepositoryPolicy.CHECKSUM_POLICY_WARN))
            .setReleasePolicy(new RepositoryPolicy(true,
                                                   RepositoryPolicy.UPDATE_POLICY_ALWAYS,
                                                   RepositoryPolicy.CHECKSUM_POLICY_WARN));

    Settings settings = MavenSettings.getSettings();
    Server server = settings.getServer(repo.getId());

    if (server != null) {
        Authentication authentication = embedder.getMavenSession().getRepositorySession()
                .getAuthenticationSelector()
                .getAuthentication(remoteRepoBuilder.build());
        remoteRepoBuilder.setAuthentication(authentication);
    }

    return remoteRepoBuilder.build();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:DistributionManagementArtifactRepository.java

示例6: convertToArtifactRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private RemoteRepository convertToArtifactRepository(final org.apache.maven.artifact.repository.ArtifactRepository artifactRepository) {
    final MavenEmbedder mavenEmbedder = MavenProjectLoader.newMavenEmbedder(MavenSettings.getSettings().isOffline());
    final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(artifactRepository.getId(),
                                                                                    artifactRepository.getLayout().getId(),
                                                                                    artifactRepository.getUrl())
            .setSnapshotPolicy(new RepositoryPolicy(true,
                                                    RepositoryPolicy.UPDATE_POLICY_DAILY,
                                                    RepositoryPolicy.CHECKSUM_POLICY_WARN))
            .setReleasePolicy(new RepositoryPolicy(true,
                                                   RepositoryPolicy.UPDATE_POLICY_ALWAYS,
                                                   RepositoryPolicy.CHECKSUM_POLICY_WARN));

    final Settings settings = MavenSettings.getSettings();
    final Server server = settings.getServer(artifactRepository.getId());

    if (server != null) {
        final Authentication authentication = mavenEmbedder
                .getMavenSession()
                .getRepositorySession()
                .getAuthenticationSelector()
                .getAuthentication(remoteRepoBuilder.build());
        remoteRepoBuilder.setAuthentication(authentication);
    }

    return remoteRepoBuilder.build();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:ProjectRepositoryResolverImpl.java

示例7: getRemoteRepoFromDeployment

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private static RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository deploymentRepository,
                                                            final RepositorySystemSession mavenSession) {
    final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(deploymentRepository.getId(),
                                                                                    deploymentRepository.getLayout(),
                                                                                    deploymentRepository.getUrl())
            .setSnapshotPolicy(new RepositoryPolicy(true,
                                                    RepositoryPolicy.UPDATE_POLICY_DAILY,
                                                    RepositoryPolicy.CHECKSUM_POLICY_WARN))
            .setReleasePolicy(new RepositoryPolicy(true,
                                                   RepositoryPolicy.UPDATE_POLICY_DAILY,
                                                   RepositoryPolicy.CHECKSUM_POLICY_WARN));

    final Settings settings = MavenSettings.getSettings();
    final Server server = settings.getServer(deploymentRepository.getId());

    if (server != null) {
        final Authentication authentication = mavenSession
                .getAuthenticationSelector()
                .getAuthentication(remoteRepoBuilder.build());
        remoteRepoBuilder.setAuthentication(authentication);
    }

    return remoteRepoBuilder.build();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:RepositoryResolverTestUtils.java

示例8: remoteRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public RemoteRepository remoteRepository(MavenProject project) throws MojoExecutionException {
  if (altDeploymentRepository != null) {
    Matcher matcher = Pattern.compile("(.+)::(.+)::(.+)").matcher(altDeploymentRepository);
    if (!matcher.matches()) {
      throw new MojoExecutionException(altDeploymentRepository, "Invalid syntax for repository.", "Invalid syntax for alternative repository. Use \"id::layout::url\".");
    }

    String id = matcher.group(1).trim();
    String layout = matcher.group(2).trim();
    String url = matcher.group(3).trim();

    RemoteRepository.Builder builder = new RemoteRepository.Builder(id, layout, url);

    return builder.build();
  }

  return AetherUtils.toRepo(project.getDistributionManagementArtifactRepository());
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:19,代码来源:Deploy.java

示例9: centralRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private static List<RemoteRepository> centralRepository(RepositorySystem system) {
  RemoteRepository.Builder builder =
      new RemoteRepository.Builder("central", "default", "https://repo.maven.apache.org/maven2/");
  RemoteRepository repository = builder.build();
  List<RemoteRepository> repositories = new ArrayList<>();
  repositories.add(repository);
  return repositories;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:9,代码来源:DependencyResolver.java

示例10: addResolver

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
@Override
public void addResolver(Map<String, Object> args) {
	String name = (String) args.get("name");
	String root = (String) args.get("root");
	RemoteRepository.Builder builder = new RemoteRepository.Builder(name, "default",
			root);
	RemoteRepository repository = builder.build();
	addRepository(repository);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:AetherGrapeEngine.java

示例11: applyProxy

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private RemoteRepository applyProxy(RemoteRepository repository) {
	if (repository.getProxy() == null) {
		RemoteRepository.Builder builder = new RemoteRepository.Builder(repository);
		builder.setProxy(this.session.getProxySelector().getProxy(repository));
		repository = builder.build();
	}
	return repository;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:AetherGrapeEngine.java

示例12: applyAuthentication

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private RemoteRepository applyAuthentication(RemoteRepository repository) {
	if (repository.getAuthentication() == null) {
		RemoteRepository.Builder builder = new RemoteRepository.Builder(repository);
		builder.setAuthentication(this.session.getAuthenticationSelector()
				.getAuthentication(repository));
		repository = builder.build();
	}
	return repository;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:AetherGrapeEngine.java

示例13: createRemoteRepositoryBuilder

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public RemoteRepository.Builder createRemoteRepositoryBuilder(){
	RemoteRepository.Builder builder=new RemoteRepository.Builder(getId(),"default",getUrl());
	builder.setReleasePolicy((getReleasePolicy()!=null ? getReleasePolicy().createRepositoryPolicy() : null));
	builder.setSnapshotPolicy((getSnapshotPolicy()!=null ? getSnapshotPolicy().createRepositoryPolicy() : null));
	builder.setRepositoryManager(true);

	return builder;
}
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:9,代码来源:RepositoryConfig.java

示例14: createRemoteRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public RemoteRepository createRemoteRepository(RemoteRepository.Builder mirroredRemoteRepositoryBuilder){
	RemoteRepository mirroredRemoteRepository=mirroredRemoteRepositoryBuilder.build();
	RemoteRepository.Builder builder=new RemoteRepository.Builder(mirroredRemoteRepository);
	builder.setId(getId());
	builder.setUrl(getUrl());
	builder.addMirroredRepository(mirroredRemoteRepository);
	RemoteRepository mirrorRepository=builder.build();
	return mirrorRepository;
}
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:10,代码来源:MirrorConfig.java

示例15: buildRemoteRepository

import org.eclipse.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private RemoteRepository buildRemoteRepository(final String id, final String url, final Authentication auth,
                                               final ArtifactRepositoryPolicy releasesPolicy, final ArtifactRepositoryPolicy snapshotsPolicy) {
    RemoteRepository.Builder builder = new RemoteRepository.Builder(id, "default", url);
    if (auth != null
            && auth.getUsername() != null
            && auth.getPassword() != null) {
        builder.setAuthentication(new AuthenticationBuilder()
                                          .addUsername(auth.getUsername())
                                          .addPassword(auth.getPassword()).build());
    }

    builder.setSnapshotPolicy(new RepositoryPolicy(snapshotsPolicy.isEnabled(), snapshotsPolicy.getUpdatePolicy(), snapshotsPolicy.getChecksumPolicy()));
    builder.setReleasePolicy(new RepositoryPolicy(releasesPolicy.isEnabled(), releasesPolicy.getUpdatePolicy(), releasesPolicy.getChecksumPolicy()));

    RemoteRepository repository = builder.build();

    final RemoteRepository mirror = session.getMirrorSelector().getMirror(repository);

    if (mirror != null) {
        final org.eclipse.aether.repository.Authentication mirrorAuth = session.getAuthenticationSelector()
                .getAuthentication(mirror);
        RemoteRepository.Builder mirrorBuilder = new RemoteRepository.Builder(mirror)
                .setId(repository.getId())
                .setSnapshotPolicy(new RepositoryPolicy(snapshotsPolicy.isEnabled(), snapshotsPolicy.getUpdatePolicy(), snapshotsPolicy.getChecksumPolicy()))
                .setReleasePolicy(new RepositoryPolicy(releasesPolicy.isEnabled(), releasesPolicy.getUpdatePolicy(), releasesPolicy.getChecksumPolicy()));
        if (mirrorAuth != null) {
            mirrorBuilder.setAuthentication(mirrorAuth);
        }
        repository = mirrorBuilder.build();
    }

    Proxy proxy = session.getProxySelector().getProxy(repository);

    if (proxy != null) {
        repository = new RemoteRepository.Builder(repository).setProxy(proxy).build();
    }

    return repository;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:40,代码来源:MavenArtifactResolvingHelper.java


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