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


Java RemoteRepository.setPolicy方法代码示例

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


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

示例1: addRepoFromProperty

import org.sonatype.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private void addRepoFromProperty(String listOfRepo) {
  if (listOfRepo != null) {
    String[] repos = listOfRepo.split(";");
    for (String repo : repos) {
      String[] parts = repo.split(",");
      if (parts.length == 3) {
        String id = parts[0].trim();
        String url = parts[1].trim();
        boolean isSnapshot = Boolean.parseBoolean(parts[2].trim());
        if (id.length() > 1 && url.length() > 1) {
          RemoteRepository rr = new RemoteRepository(id, "default", url);
          rr.setPolicy(isSnapshot, null);
          additionalRepos.add(rr);
        }
      }
    }
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:19,代码来源:DependencyContext.java

示例2: fetchArtifactWithDep

import org.sonatype.aether.repository.RemoteRepository; //导入方法依赖的package包/类
private List<ArtifactResult> fetchArtifactWithDep(Dependency dep)
    throws DependencyResolutionException, ArtifactResolutionException {
  Artifact artifact = new DefaultArtifact(dep.getGroupArtifactVersion());

  DependencyFilter classpathFilter = DependencyFilterUtils
      .classpathFilter(JavaScopes.COMPILE);
  PatternExclusionsDependencyFilter exclusionFilter = new PatternExclusionsDependencyFilter(
      dep.getExclusions());

  CollectRequest collectRequest = new CollectRequest();
  collectRequest.setRoot(new org.sonatype.aether.graph.Dependency(artifact,
      JavaScopes.COMPILE));

  collectRequest.addRepository(mavenCentral);
  collectRequest.addRepository(mavenLocal);
  for (Repository repo : repositories) {
    RemoteRepository rr = new RemoteRepository(repo.getId(), "default", repo.getUrl());
    rr.setPolicy(repo.isSnapshot(), null);
    collectRequest.addRepository(rr);
  }

  DependencyRequest dependencyRequest = new DependencyRequest(collectRequest,
      DependencyFilterUtils.andFilter(exclusionFilter, classpathFilter));

  return system.resolveDependencies(session, dependencyRequest).getArtifactResults();
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:27,代码来源:DependencyContext.java

示例3: addRepo

import org.sonatype.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public void addRepo(String id, String url, boolean snapshot) {
  synchronized (repos) {
    delRepo(id);
    RemoteRepository rr = new RemoteRepository(id, "default", url);
    rr.setPolicy(snapshot, null);
    repos.add(rr);
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:9,代码来源:DependencyResolver.java

示例4: addRepo

import org.sonatype.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public void addRepo(String id, String url, boolean snapshot) {
  synchronized (repos) {
    delRepo(id);
    RemoteRepository rr = new RemoteRepository(id, "default", url);
    rr.setPolicy(snapshot, new RepositoryPolicy(
        true,
        RepositoryPolicy.UPDATE_POLICY_DAILY,
        RepositoryPolicy.CHECKSUM_POLICY_WARN));
    repos.add(rr);
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:12,代码来源:AbstractDependencyResolver.java

示例5: toRemoteRepository

import org.sonatype.aether.repository.RemoteRepository; //导入方法依赖的package包/类
public static RemoteRepository toRemoteRepository( Repository repository )
{
    RemoteRepository result =
        new RemoteRepository( repository.getId(), repository.getLayout(), repository.getUrl() );
    result.setPolicy( true, toRepositoryPolicy( repository.getSnapshots() ) );
    result.setPolicy( false, toRepositoryPolicy( repository.getReleases() ) );
    return result;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:ArtifactDescriptorUtils.java


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