• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ArtifactDescriptorException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ArtifactDescriptorException类属于org.eclipse.aether.resolution包,在下文中一共展示了ArtifactDescriptorException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getRejectedDependencies

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的package包/类
public Set<Artifact> getRejectedDependencies(Artifact artifact) throws ArtifactDescriptorException {
    Set<Dependency> allDependencies = getAllDependencies(artifact);

    Set<Artifact> rejected = new HashSet<>();
    for (Dependency dependency : allDependencies) {
        Scope scope = Scope.compile;
        try {
            scope = Scope.valueOf(dependency.getScope().toLowerCase());
        } catch (Throwable ignored) { }

        if (ignoredScopes.contains(scope)) {
            continue;
        }

        if ((dependency.getArtifact().isSnapshot() && rejectSnapshots) || notAllowed(allowedArtifacts, dependency)) {
            rejected.add(dependency.getArtifact());
        }
    }

    return rejected;
}
 
开发者ID:flipkart-incubator,项目名称:Poseidon,代码行数:22,代码来源:Cadfael.java


示例2: hasTransitiveSnapshots

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的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


示例3: getAllDependencies

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的package包/类
public Set<Dependency> getAllDependencies(Artifact artifact) throws ArtifactDescriptorException {
    ArtifactDescriptorRequest request = new ArtifactDescriptorRequest(artifact, repositories, null);
    ArtifactDescriptorResult result = system.readArtifactDescriptor(session, request);

    Set<Dependency> dependencies = new HashSet<>(result.getManagedDependencies());
    dependencies.addAll(result.getDependencies());

    return dependencies;
}
 
开发者ID:flipkart-incubator,项目名称:Poseidon,代码行数:10,代码来源:Cadfael.java


示例4: getDependencies

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的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


示例5: readArtifactDescriptor

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的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


示例6: getDependenciesOf

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的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


示例7: buildDependencyGraph

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的package包/类
private MutableDirectedGraph<Artifact> buildDependencyGraph(Map<String, Artifact> knownDeps)
    throws ArtifactDescriptorException {
  MutableDirectedGraph<Artifact> graph;
  graph = new MutableDirectedGraph<>();
  for (Map.Entry<String, Artifact> entry : knownDeps.entrySet()) {
    String key = entry.getKey();
    Artifact artifact = entry.getValue();

    graph.addNode(artifact);

    List<Dependency> dependencies = getDependenciesOf(artifact);

    for (Dependency dependency : dependencies) {
      if (dependency.getArtifact() == null) {
        System.out.println("Skipping because artifact missing: " + dependency);
        continue;
      }

      String depKey = buildKey(dependency.getArtifact());
      Artifact actualDep = knownDeps.get(depKey);
      if (actualDep == null) {
        continue;
      }
      // It's possible that the runtime dep of an artifact is the test time dep of another.
      if (isTestTime(dependency)) {
        continue;
      }

      // TODO(simons): Do we always want optional dependencies?
      //        if (dependency.isOptional()) {
      //          continue;
      //        }

      Preconditions.checkNotNull(
          actualDep, key + " -> " + artifact + " in " + knownDeps.keySet());
      graph.addNode(actualDep);
      graph.addEdge(actualDep, artifact);
    }
  }
  return graph;
}
 
开发者ID:facebook,项目名称:buck,代码行数:42,代码来源:Resolver.java


示例8: getDependenciesTest

import org.eclipse.aether.resolution.ArtifactDescriptorException; //导入依赖的package包/类
@Test
public void getDependenciesTest() throws ArtifactDescriptorException {

    Collection<String> file = connector.getDependencies("CopperAndBronze", "0.1.0-SNAPSHOT");

    Assert.assertThat(file, IsCollectionContaining.hasItem("engine"));
}
 
开发者ID:MovingBlocks,项目名称:ModuleManager,代码行数:8,代码来源:RepositoryConnectorTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SignatureHelp类代码示例发布时间:2022-05-23
下一篇:
Java TimelineState类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap