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

Java DependencyCollectionException类代码示例

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

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



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

示例1: resolve

import org.sonatype.aether.collection.DependencyCollectionException; //导入依赖的package包/类
private void resolve( ResolveRequest resolveRequest )
{

    RepositorySystem system = newRepositorySystem();

    RepositorySystemSession session = newRepositorySystemSession( system, resolveRequest.localRepoDir );

    org.sonatype.aether.artifact.Artifact artifact = new DefaultArtifact(
        resolveRequest.groupId + ":" + resolveRequest.artifactId + ":" + resolveRequest.version );

    CollectRequest collectRequest = new CollectRequest();
    collectRequest.setRoot( new Dependency( artifact, "" ) );

    // add remote repositories
    for ( RemoteRepository remoteRepository : resolveRequest.remoteRepositories )
    {
        collectRequest.addRepository(
            new org.sonatype.aether.repository.RemoteRepository( remoteRepository.getId(), "default",
                                                                 remoteRepository.getUrl() ) );
    }
    collectRequest.setRequestContext( "project" );

    //collectRequest.addRepository( repo );

    try
    {
        CollectResult collectResult = system.collectDependencies( session, collectRequest );
        collectResult.getRoot().accept( resolveRequest.dependencyVisitor );
        log.debug( "test" );
    }
    catch ( DependencyCollectionException e )
    {
        log.error( e.getMessage(), e );
    }


}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:38,代码来源:Maven3DependencyTreeBuilder.java


示例2: collectDependenciesIntoArtifacts

import org.sonatype.aether.collection.DependencyCollectionException; //导入依赖的package包/类
private List<Artifact> collectDependenciesIntoArtifacts(CollectRequest collectRequest)
  throws PlexusContainerException, ComponentLookupException, DependencyCollectionException, ArtifactResolutionException, DependencyResolutionException {

  RepositorySystem repositorySystem = newRepositorySystem();
  RepositorySystemSession session = newSession(repositorySystem);
  DependencyNode node = repositorySystem.collectDependencies(session, collectRequest).getRoot();

  DependencyFilter filter = new ScopeDependencyFilter();

  DependencyRequest request = new DependencyRequest(node, filter);

  repositorySystem.resolveDependencies(session, request);

  // PathRecordingDependencyVisitor will give every path, which may help in building a hierarchical class loader
  PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
  node.accept(nlg);

  return nlg.getArtifacts(false);
}
 
开发者ID:zulily,项目名称:dropship,代码行数:20,代码来源:MavenArtifactResolution.java


示例3: collectDependencies

import org.sonatype.aether.collection.DependencyCollectionException; //导入依赖的package包/类
/**
 * Collects the transitive dependencies of an artifact and builds a dependency graph. Note that this operation is
 * only concerned about determining the coordinates of the transitive dependencies. To also resolve the actual
 * artifact files, use {@link #resolveDependencies(DependencyRequest)}.
 *
 * @param request The collection request, must not be {@code null}
 * @return The collection result, never {@code null}.
 * @throws org.sonatype.aether.collection.DependencyCollectionException If the dependency tree could not be built.
 * @see RepositorySystemSession#getDependencyTraverser()
 * @see RepositorySystemSession#getDependencyManager()
 * @see RepositorySystemSession#getDependencySelector()
 * @see RepositorySystemSession#getDependencyGraphTransformer()
 */
public CollectResult collectDependencies( CollectRequest request ) throws DependencyCollectionException {
    return repository.collectDependencies(session, request);
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:17,代码来源:RepositoryService.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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