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


Java ArtifactDescriptorRequest.setRepositories方法代码示例

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


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

示例1: hasTransitiveSnapshots

import org.eclipse.aether.resolution.ArtifactDescriptorRequest; //导入方法依赖的package包/类
private boolean hasTransitiveSnapshots(Dependency dependency) throws MojoFailureException {
    ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
    descriptorRequest.setArtifact(
            new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), dependency.getType(), dependency.getVersion()));
    descriptorRequest.setRepositories(remoteRepos);

    try {
        ArtifactDescriptorResult result = repoSystem.readArtifactDescriptor(repoSession, descriptorRequest);
        Optional<org.eclipse.aether.graph.Dependency> snapshotDependency = result.getDependencies().stream()
                .filter(d -> d.getArtifact().isSnapshot())
                .findFirst();
        return snapshotDependency.isPresent();
    } catch (ArtifactDescriptorException e) {
        throw new MojoFailureException(e.getMessage(), e);
    }
}
 
开发者ID:msoute,项目名称:vertx-deploy-tools,代码行数:17,代码来源:DeployUtils.java

示例2: getDependencies

import org.eclipse.aether.resolution.ArtifactDescriptorRequest; //导入方法依赖的package包/类
public Collection<String> getDependencies(String moduleId, String version) throws ArtifactDescriptorException {
    Artifact artifact = new DefaultArtifact(groupId, moduleId, "jar", version);

    ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
    descriptorRequest.setArtifact(artifact);
    descriptorRequest.setRepositories(repos);

    ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor(session, descriptorRequest);

    List<String> deps = Lists.newArrayList();
    for (Dependency dep : descriptorResult.getDependencies()) {
        deps.add(dep.getArtifact().getArtifactId());
    }
    return deps;
}
 
开发者ID:MovingBlocks,项目名称:ModuleManager,代码行数:16,代码来源:RepositoryConnector.java

示例3: readArtifactDescriptor

import org.eclipse.aether.resolution.ArtifactDescriptorRequest; //导入方法依赖的package包/类
private ArtifactDescriptorResult readArtifactDescriptor(AddonId addonId) throws ArtifactDescriptorException
{
   String coords = toMavenCoords(addonId);
   RepositorySystem system = container.getRepositorySystem();
   Settings settings = getSettings();
   DefaultRepositorySystemSession session = container.setupRepoSession(system, settings);
   List<RemoteRepository> repositories = MavenRepositories.getRemoteRepositories(container, settings);
   ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
   request.setArtifact(new DefaultArtifact(coords));
   request.setRepositories(repositories);

   ArtifactDescriptorResult result = system.readArtifactDescriptor(session, request);
   return result;
}
 
开发者ID:forge,项目名称:furnace,代码行数:15,代码来源:MavenAddonDependencyResolver.java

示例4: getDependenciesOf

import org.eclipse.aether.resolution.ArtifactDescriptorRequest; //导入方法依赖的package包/类
private List<Dependency> getDependenciesOf(Artifact dep) throws ArtifactDescriptorException {
  ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
  descriptorRequest.setArtifact(dep);
  descriptorRequest.setRepositories(repos);
  descriptorRequest.setRequestContext(JavaScopes.RUNTIME);

  ArtifactDescriptorResult result = repoSys.readArtifactDescriptor(session, descriptorRequest);
  return result.getDependencies();
}
 
开发者ID:facebook,项目名称:buck,代码行数:10,代码来源:Resolver.java


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