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


Java RepositoryConnectorFactory类代码示例

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


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

示例1: create

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public RepositorySystem create() throws Throwable{

        DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
        locator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
        locator.addService( TransporterFactory.class, FileTransporterFactory.class );
        locator.addService( TransporterFactory.class, HttpTransporterFactory.class );

        final List<Throwable> ecs=new ArrayList<Throwable>();
        locator.setErrorHandler( new DefaultServiceLocator.ErrorHandler()
        {
            @Override
            public void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )
            {
                ecs.add(exception);
            }
        } );
        RepositorySystem repositorySystem=locator.getService( RepositorySystem.class );
        if (!ecs.isEmpty()){
        	throw ecs.get(0);
        }

        return repositorySystem;
    }
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:24,代码来源:RepositorySystemBuilder.java

示例2: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
private RepositorySystem newRepositorySystem() {
	/*
	 * Aether's components implement org.eclipse.aether.spi.locator.Service
	 * to ease manual wiring and using the prepopulated
	 * DefaultServiceLocator, we only need to register the repository
	 * connector and transporter factories.
	 */
	final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
	locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
	locator.addService(TransporterFactory.class, FileTransporterFactory.class);

	locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
		@Override
		public void serviceCreationFailed(final Class<?> type, final Class<?> impl, final Throwable exception) {
			exception.printStackTrace();
		}
	});

	return locator.getService(RepositorySystem.class);
}
 
开发者ID:SourcePond,项目名称:release-maven-plugin-parent,代码行数:21,代码来源:NestedModulesBaseTest.java

示例3: configure

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
@Override
protected void configure() {
	bind(ModelLocator.class).to(DefaultModelLocator.class).in(Singleton.class);
	bind(ModelReader.class).to(DefaultModelReader.class).in(Singleton.class);
	bind(ModelValidator.class).to(DefaultModelValidator.class).in(Singleton.class);
	bind(RepositoryConnectorFactory.class).to(BasicRepositoryConnectorFactory.class)
			.in(Singleton.class);
	bind(ArtifactDescriptorReader.class) //
			.to(DefaultArtifactDescriptorReader.class).in(Singleton.class);
	bind(VersionResolver.class) //
			.to(DefaultVersionResolver.class).in(Singleton.class);
	bind(VersionRangeResolver.class) //
			.to(DefaultVersionRangeResolver.class).in(Singleton.class);
	bind(MetadataGeneratorFactory.class).annotatedWith(Names.named("snapshot")) //
			.to(SnapshotMetadataGeneratorFactory.class).in(Singleton.class);
	bind(MetadataGeneratorFactory.class).annotatedWith(Names.named("versions")) //
			.to(VersionsMetadataGeneratorFactory.class).in(Singleton.class);
	bind(TransporterFactory.class).annotatedWith(Names.named("http"))
			.to(HttpTransporterFactory.class).in(Singleton.class);
	bind(TransporterFactory.class).annotatedWith(Names.named("file"))
			.to(FileTransporterFactory.class).in(Singleton.class);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:23,代码来源:DependencyResolver.java

示例4: AetherResolver

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public AetherResolver() {
  localMavenRepo = System.getProperty(LOCAL_REPO_SYS_PROP, DEFAULT_MAVEN_LOCAL);
  String remoteString = System.getProperty(REMOTE_REPOS_SYS_PROP, DEFAULT_MAVEN_REMOTES);
  // They are space delimited (space is illegal char in urls)
  remoteMavenRepos = Arrays.asList(remoteString.split(" "));
  httpProxy = System.getProperty(HTTP_PROXY_SYS_PROP);
  httpsProxy = System.getProperty(HTTPS_PROXY_SYS_PROP);

  DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
  locator.addService(RepositoryConnectorFactory.class, AetherRepositoryConnectorFactory.class);
  locator.addService(LocalRepositoryManagerFactory.class, TakariLocalRepositoryManagerFactory.class);
  locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler()
  {
    @Override
    public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
      exception.printStackTrace();
    }
  });
  this.repositorySystem = locator.getService(RepositorySystem.class);
}
 
开发者ID:cstamas,项目名称:vertx-sisu,代码行数:21,代码来源:AetherResolver.java

示例5: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static RepositorySystem newRepositorySystem ()
{
    final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator ();

    locator.addService ( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
    locator.addService ( TransporterFactory.class, FileTransporterFactory.class );
    locator.addService ( TransporterFactory.class, HttpTransporterFactory.class );

    locator.setErrorHandler ( new ErrorHandler () {
        @Override
        public void serviceCreationFailed ( final Class<?> type, final Class<?> impl, final Throwable exception )
        {
            final Logger logger = LoggerFactory.getLogger ( impl );
            logger.warn ( "Service creation failed: " + type.getName (), exception );
        }
    } );

    return locator.getService ( RepositorySystem.class );
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:20,代码来源:Helper.java

示例6: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static RepositorySystem newRepositorySystem ()
{
    final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator ();
    locator.addService ( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
    locator.addService ( TransporterFactory.class, FileTransporterFactory.class );
    locator.addService ( TransporterFactory.class, HttpTransporterFactory.class );

    locator.setErrorHandler ( new DefaultServiceLocator.ErrorHandler () {
        @Override
        public void serviceCreationFailed ( final Class<?> type, final Class<?> impl, final Throwable exception )
        {
            exception.printStackTrace ();
        }
    } );

    return locator.getService ( RepositorySystem.class );
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:18,代码来源:MavenUtil.java

示例7: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
private static RepositorySystem newRepositorySystem()
{
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    //locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
    //    @Override
    //    public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception)
    //    {
    //        exception.printStackTrace();
    //    }
    //});

    return locator.getService(RepositorySystem.class);
}
 
开发者ID:treasure-data,项目名称:digdag,代码行数:18,代码来源:RemotePluginLoader.java

示例8: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public RepositorySystem newRepositorySystem() {
       /*
        * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
        * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
        * factories.
        */
	DefaultServiceLocator defaultLocator = MavenRepositorySystemUtils.newServiceLocator();
	defaultLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
	defaultLocator.addService(TransporterFactory.class, FileTransporterFactory.class);
	defaultLocator.addService(TransporterFactory.class, HttpTransporterFactory.class);


	defaultLocator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
		@Override
		public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
			exception.printStackTrace();
		}
	});

	return defaultLocator.getService(RepositorySystem.class);

}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:23,代码来源:AetherConfigurer.java

示例9: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
private static RepositorySystem newRepositorySystem() {
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
    locator.addService(TransporterFactory.class, ClasspathTransporterFactory.class);

    locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
            logger.error("", exception);
        }
    });

    return locator.getService(RepositorySystem.class);
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:17,代码来源:PluginManager.java

示例10: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
static RepositorySystem newRepositorySystem() {
        /*
         * Aether's components implement
         * org.sonatype.aether.spi.locator.Service to ease manual wiring and
         * using the prepopulated DefaultServiceLocator, we only need to
         * register the repository connector factories.
         */

    DefaultServiceLocator locator = new DefaultServiceLocator();
    locator.addService(ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class);
    locator.addService(VersionResolver.class, DefaultVersionResolver.class);
    locator.addService(VersionRangeResolver.class, DefaultVersionRangeResolver.class);
    locator.addService(MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class);
    locator.addService(MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class);
    locator.setErrorHandler(new MyErrorHandler());

    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    //locator.addService(TransporterFactory.class, WagonTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);


    return locator.getService(RepositorySystem.class);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:MavenUtil.java

示例11: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
/**
 * Initializes repository system
 *
 * @return repository system
 */
private static RepositorySystem newRepositorySystem() {
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
            LOGGER.error("Failed co create service {} using implementation {}", type, impl, exception);
        }
    });

    return locator.getService(RepositorySystem.class);
}
 
开发者ID:sourcegraph,项目名称:srclib-java,代码行数:21,代码来源:MavenProject.java

示例12: RepositoryConnector

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
/**
     * @param file
     * @param system
     */
    public RepositoryConnector(File baseDir) {

        /*
         * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
         * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
         * factories.
         */
        DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
        locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
//        locator.addService(TransporterFactory.class, FileTransporterFactory.class);
        locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

        locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler()
        {
            @Override
            public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
                logger.error("Could not create service {}", type, exception);
            }
        });

        system = locator.getService(RepositorySystem.class);
        session = createSession(system, baseDir);
    }
 
开发者ID:MovingBlocks,项目名称:ModuleManager,代码行数:28,代码来源:RepositoryConnector.java

示例13: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static RepositorySystem newRepositorySystem() {
	/*
	 * Aether's components implement org.eclipse.aether.spi.locator.Service
	 * to ease manual wiring and using the prepopulated
	 * DefaultServiceLocator, we only need to register the repository
	 * connector and transporter factories.
	 */
	DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
	locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
	locator.addService(TransporterFactory.class, FileTransporterFactory.class);
	locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

	locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
		@Override
		public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
			exception.printStackTrace();
		}
	});

	return locator.getService(RepositorySystem.class);
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:22,代码来源:RemotePluginRepository.java

示例14: newRepositorySystem

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static RepositorySystem newRepositorySystem() {
    /*
     * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
     * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
     * factories.
     */
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
            LOG.error(exception.getMessage(), exception);
        }
    });
    return locator.getService(RepositorySystem.class);
}
 
开发者ID:msoute,项目名称:vertx-deploy-tools,代码行数:20,代码来源:AetherUtil.java

示例15: initServiceLocator

import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static ServiceLocator initServiceLocator() {
  DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
  locator.setErrorHandler(
      new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
          throw new RuntimeException(
              String.format(
                  "Failed to initialize service %s, implemented by %s: %s",
                  type.getName(), impl.getName(), exception.getMessage()),
              exception);
        }
      });
  locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
  locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
  locator.addService(TransporterFactory.class, FileTransporterFactory.class);
  // Use a no-op logger. Leaving this out would introduce a runtime dependency on log4j
  locator.addService(ILoggerFactory.class, NOPLoggerFactory.class);
  // Also requires log4j
  //    locator.addService(ILoggerFactory.class, Log4jLoggerFactory.class);
  return locator;
}
 
开发者ID:facebook,项目名称:buck,代码行数:23,代码来源:AetherUtil.java


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