當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。