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


Java RepositorySystem类代码示例

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


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

示例1: DummyAetherRepository

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
public DummyAetherRepository(Path baseTempDir) throws IOException {
    tempDir = Files.createTempDirectory(baseTempDir, getClass().getSimpleName());
    try {
        jaxbContext = JAXBContext.newInstance(MutableBundle.class);
    } catch (JAXBException exception) {
        throw new IllegalStateException("Failed to create JAXB context.", exception);
    }

    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    repositorySystem = locator.getService(RepositorySystem.class);
    repositorySystemSession = MavenRepositorySystemUtils.newSession();
    localRepository
        = new LocalRepository(Files.createTempDirectory(tempDir, "maven-repo").toFile(), SIMPLE_REPOSITORY_MANAGER);
    repositorySystemSession.setLocalRepositoryManager(
        repositorySystem.newLocalRepositoryManager(repositorySystemSession, localRepository)
    );
}
 
开发者ID:cloudkeeper-project,项目名称:cloudkeeper,代码行数:18,代码来源:DummyAetherRepository.java

示例2: create

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
public static AetherGrapeEngine create(GroovyClassLoader classLoader,
		List<RepositoryConfiguration> repositoryConfigurations,
		DependencyResolutionContext dependencyResolutionContext) {

	RepositorySystem repositorySystem = createServiceLocator()
			.getService(RepositorySystem.class);

	DefaultRepositorySystemSession repositorySystemSession = MavenRepositorySystemUtils
			.newSession();

	ServiceLoader<RepositorySystemSessionAutoConfiguration> autoConfigurations = ServiceLoader
			.load(RepositorySystemSessionAutoConfiguration.class);

	for (RepositorySystemSessionAutoConfiguration autoConfiguration : autoConfigurations) {
		autoConfiguration.apply(repositorySystemSession, repositorySystem);
	}

	new DefaultRepositorySystemSessionAutoConfiguration()
			.apply(repositorySystemSession, repositorySystem);

	return new AetherGrapeEngine(classLoader, repositorySystem,
			repositorySystemSession, createRepositories(repositoryConfigurations),
			dependencyResolutionContext);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:25,代码来源:AetherGrapeEngineFactory.java

示例3: AetherGrapeEngine

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
public AetherGrapeEngine(GroovyClassLoader classLoader,
		RepositorySystem repositorySystem,
		DefaultRepositorySystemSession repositorySystemSession,
		List<RemoteRepository> remoteRepositories,
		DependencyResolutionContext resolutionContext) {
	this.classLoader = classLoader;
	this.repositorySystem = repositorySystem;
	this.session = repositorySystemSession;
	this.resolutionContext = resolutionContext;
	this.repositories = new ArrayList<RemoteRepository>();
	List<RemoteRepository> remotes = new ArrayList<RemoteRepository>(
			remoteRepositories);
	Collections.reverse(remotes); // priority is reversed in addRepository
	for (RemoteRepository repository : remotes) {
		addRepository(repository);
	}
	this.progressReporter = getProgressReporter(this.session);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:AetherGrapeEngine.java

示例4: apply

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
@Override
public void apply(DefaultRepositorySystemSession session,
		RepositorySystem repositorySystem) {

	if (session.getLocalRepositoryManager() == null) {
		LocalRepository localRepository = new LocalRepository(getM2RepoDirectory());
		LocalRepositoryManager localRepositoryManager = repositorySystem
				.newLocalRepositoryManager(session, localRepository);
		session.setLocalRepositoryManager(localRepositoryManager);
	}

	ProxySelector existing = session.getProxySelector();
	if (existing == null || !(existing instanceof CompositeProxySelector)) {
		JreProxySelector fallback = new JreProxySelector();
		ProxySelector selector = existing == null ? fallback
				: new CompositeProxySelector(Arrays.asList(existing, fallback));
		session.setProxySelector(selector);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:20,代码来源:DefaultRepositorySystemSessionAutoConfiguration.java

示例5: create

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例6: newRepositorySystemSession

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) {
	DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
	LocalRepository localRepo = new LocalRepository(localRepoPath);
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
	session.setOffline(this.properties.isOffline());
	if (this.properties.getConnectTimeout() != null) {
		session.setConfigProperty(ConfigurationProperties.CONNECT_TIMEOUT, this.properties.getConnectTimeout());
	}
	if (this.properties.getRequestTimeout() != null) {
		session.setConfigProperty(ConfigurationProperties.REQUEST_TIMEOUT, this.properties.getRequestTimeout());
	}
	if (isProxyEnabled()) {
		DefaultProxySelector proxySelector = new DefaultProxySelector();
		Proxy proxy = new Proxy(this.properties.getProxy().getProtocol(),
				this.properties.getProxy().getHost(),
				this.properties.getProxy().getPort(),
				this.authentication);
		proxySelector.add(proxy, this.properties.getProxy().getNonProxyHosts());
		session.setProxySelector(proxySelector);
	}
	return session;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer,代码行数:23,代码来源:MavenArtifactResolver.java

示例7: newRepositorySystem

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例8: AetherResolver

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例9: newRepositorySystem

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例10: newRepositorySystem

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例11: newRepositorySystem

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例12: newRepositorySystemSession

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(
		RepositorySystem system) {

	DefaultRepositorySystemSession session = MavenRepositorySystemUtils
			.newSession();

	// every container must have one
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(
			session, findLocalRepository()));

	// logging for the activity
	PrintStream logger = new LoggerStream(LOG, Level.INFO);
	session.setTransferListener(new LoggingTransferListener());
	session.setRepositoryListener(new LoggingRepositoryListener());

	// uncomment to generate dirty trees
	// session.setDependencyGraphTransformer( null );

	// ignore checksums on smartbear
	session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);

	return session;
}
 
开发者ID:bertramn,项目名称:soapui-junit-mockrunner,代码行数:24,代码来源:AetherClasspathResolver.java

示例13: resolveDependencies

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
private List<Artifact> resolveDependencies(final Artifact artifact) throws DependencyResolutionException {
    List<Artifact> result = new ArrayList<Artifact>();

    RepositorySystem system = newRepositorySystem();
    CollectRequest collectRequest = new CollectRequest();
    collectRequest.setRoot(new org.eclipse.aether.graph.Dependency(artifact, JavaScopes.COMPILE));
    List<ArtifactResult> dependenciesTree = system.resolveDependencies(
            session,
            new DependencyRequest(collectRequest, DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE))
    ).getArtifactResults();
    for (final ArtifactResult res : dependenciesTree) {
        result.add(res.getArtifact());
    }

    return result;
}
 
开发者ID:smoope,项目名称:j2objc-maven-plugin,代码行数:17,代码来源:J2ObjCConverterMojo.java

示例14: newRepositorySystem

import org.eclipse.aether.RepositorySystem; //导入依赖的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

示例15: getSdk

import org.eclipse.aether.RepositorySystem; //导入依赖的package包/类
public static File getSdk(MavenProject project, RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository>... repos)
    throws MojoExecutionException {
  Artifact artifact = (Artifact) find(project.getPluginArtifacts(), new Predicate<Artifact>() {
    @Override
    public boolean apply(Artifact artifact1) {
      return (artifact1.getArtifactId().equals("appengine-maven-plugin")
              && artifact1.getGroupId().equals("com.google.appengine"));
    }
  });

  String version = artifact.getVersion();

  if(version.endsWith("-SNAPSHOT")) {
    String newestVersion = determineNewestVersion(repoSystem, repoSession, repos);
    return getSdk(newestVersion, repoSystem, repoSession, repos);
  }

  return getSdk(version, repoSystem, repoSession, repos);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-maven-plugin,代码行数:20,代码来源:SdkResolver.java


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