Java Code Examples for org.eclipse.aether.util.repository.DefaultMirrorSelector#add()

The following examples show how to use org.eclipse.aether.util.repository.DefaultMirrorSelector#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MavenPluginRepository.java    From BIMserver with GNU Affero General Public License v3.0 6 votes vote down vote up
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, File localRepoFile, Settings settings) {
	DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
	if (!settings.getMirrors().isEmpty()) {
		DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector();
		for (Mirror mirror : settings.getMirrors()) {
			mirrorSelector.add(mirror.getId(), mirror.getUrl(), "default", true, mirror.getMirrorOf(), "*");
		}
		session.setMirrorSelector(mirrorSelector);
	}
	session.setProxySelector(proxySelector);

	LocalRepository localRepo = new LocalRepository(localRepoFile);
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));

	return session;
}
 
Example 2
Source File: MavenSettings.java    From spring-init with Apache License 2.0 5 votes vote down vote up
private MirrorSelector createMirrorSelector(Settings settings) {
	DefaultMirrorSelector selector = new DefaultMirrorSelector();
	for (Mirror mirror : settings.getMirrors()) {
		selector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false,
				mirror.getMirrorOf(), mirror.getMirrorOfLayouts());
	}
	return selector;
}
 
Example 3
Source File: MavenSettings.java    From spring-cloud-function with Apache License 2.0 5 votes vote down vote up
private MirrorSelector createMirrorSelector(Settings settings) {
	DefaultMirrorSelector selector = new DefaultMirrorSelector();
	for (Mirror mirror : settings.getMirrors()) {
		selector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false,
				mirror.getMirrorOf(), mirror.getMirrorOfLayouts());
	}
	return selector;
}
 
Example 4
Source File: MavenContainer.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
private DefaultMirrorSelector createMirrorSelector(Settings settings)
{
   final DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector();
   final List<Mirror> mirrors = settings.getMirrors();
   if (mirrors != null)
   {
      for (Mirror mirror : mirrors)
      {
         mirrorSelector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(),
                  mirror.getMirrorOfLayouts());
      }
   }
   return mirrorSelector;
}