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


Java CollectRequest.addRepository方法代码示例

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


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

示例1: RepositorySystemHelper

import org.eclipse.aether.collection.CollectRequest; //导入方法依赖的package包/类
/**
 * Initalizes the aether environment. Uses these repositories:
 * <ul>
 * <li>http://central.maven.org/maven2/
 * </ul>
 * 
 * @param localRepoDir
 *          path where to put the downloaded dependencies
 * @param extraRepos
 *          map with extra repositories <id, url>.
 */
public RepositorySystemHelper(String localRepoDir, Map<String, String> extraRepos) {
  repoSystem = newRepositorySystem();

  session = newSession(repoSystem, localRepoDir);

  RemoteRepository central = new RemoteRepository.Builder("central", "default", "http://central.maven.org/maven2/").build();

  collectRequest = new CollectRequest();
  collectRequest.addRepository(central);

  RemoteRepository repo = null;
  Iterator<Entry<String, String>> iterator = extraRepos.entrySet().iterator();
  while (iterator.hasNext()) {
    Entry<String, String> e = iterator.next();
    repo = new RemoteRepository.Builder(e.getKey(), "default", e.getValue()).build();
    collectRequest.addRepository(repo);
    log.debug("Using extra repository '{}': {}", e.getKey(), e.getValue());
  }

}
 
开发者ID:Gemba,项目名称:mvn-dd,代码行数:32,代码来源:RepositorySystemHelper.java

示例2: createCollectRequestForGAV

import org.eclipse.aether.collection.CollectRequest; //导入方法依赖的package包/类
protected CollectRequest createCollectRequestForGAV(String gav) {
    DefaultArtifact artifact = new DefaultArtifact(gav);
    Dependency dependency = new Dependency(artifact, getScope());

    CollectRequest collectRequest = new CollectRequest();
    collectRequest.setRoot(dependency);
    for (RemoteRepository repository : repositories) {
        collectRequest.addRepository(repository);
    }

    return collectRequest;
}
 
开发者ID:igor-suhorukov,项目名称:mvn-classloader,代码行数:13,代码来源:ClassLoaderBuilder.java

示例3: installDependency

import org.eclipse.aether.collection.CollectRequest; //导入方法依赖的package包/类
private void installDependency(String groupId, String artifactId, String version, RepositorySystemSession session) throws DependencyResolutionException{
	logger.info("Installing and Loading Dependency : {} - {} - {} ", groupId , artifactId, version);

	Dependency dependency = new Dependency( new DefaultArtifact(groupId, artifactId, "", "jar", version ), "compile" );
	RemoteRepository central = new RemoteRepository.Builder( "central", "default", "http://central.maven.org/maven2/" ).build();
  
	CollectRequest collectRequest = new CollectRequest();
	collectRequest.setRoot( dependency );
	collectRequest.addRepository( central );

	DependencyRequest dependencyRequest = new DependencyRequest();
	dependencyRequest.setCollectRequest( collectRequest );

	system.resolveDependencies(session, dependencyRequest ).getRoot();
}
 
开发者ID:EIS-Bonn,项目名称:Luzzu,代码行数:16,代码来源:DependencyLoader.java


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