本文整理汇总了Java中org.sonatype.aether.spi.connector.RepositoryConnectorFactory类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryConnectorFactory类的具体用法?Java RepositoryConnectorFactory怎么用?Java RepositoryConnectorFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryConnectorFactory类属于org.sonatype.aether.spi.connector包,在下文中一共展示了RepositoryConnectorFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ArtifactResolver
import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public ArtifactResolver(String localRepositoryDir, List<String> remoteRepositoryUris)
{
MavenServiceLocator locator = new MavenServiceLocator();
locator.addService(RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class);
locator.addService(RepositoryConnectorFactory.class, AsyncRepositoryConnectorFactory.class);
repositorySystem = locator.getService(RepositorySystem.class);
repositorySystemSession = new MavenRepositorySystemSession();
LocalRepositoryManager localRepositoryManager = new SimpleLocalRepositoryManager(localRepositoryDir);
repositorySystemSession.setLocalRepositoryManager(localRepositoryManager);
repositorySystemSession.setTransferListener(new ConsoleTransferListener());
repositorySystemSession.setRepositoryListener(new ConsoleRepositoryListener());
List<RemoteRepository> repositories = new ArrayList<>(remoteRepositoryUris.size());
int index = 0;
for (String repositoryUri : remoteRepositoryUris) {
repositories.add(new RemoteRepository("repo-" + index++, "default", repositoryUri));
}
this.repositories = Collections.unmodifiableList(repositories);
}
示例2: newRepositorySystem
import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
private RepositorySystem newRepositorySystem()
{
DefaultServiceLocator locator = new DefaultServiceLocator();
locator.addService( RepositoryConnectorFactory.class,
ArchivaRepositoryConnectorFactory.class );// FileRepositoryConnectorFactory.class );
locator.addService( VersionResolver.class, DefaultVersionResolver.class );
locator.addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class );
locator.addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class );
//locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
//locator.setServices( WagonProvider.class, );
return locator.getService( RepositorySystem.class );
}
示例3: newRepositorySystem
import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static RepositorySystem newRepositorySystem() {
DefaultServiceLocator locator = new DefaultServiceLocator();
locator.addService(RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class);
locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);
locator.setServices(WagonProvider.class, new ManualWagonProvider());
return locator.getService(RepositorySystem.class);
}
示例4: repositorySystem
import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public static RepositorySystem repositorySystem()
{
MavenServiceLocator locator = new MavenServiceLocator();
locator.addService( RepositoryConnectorFactory.class, AsyncRepositoryConnectorFactory.class);
locator.addService(RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class);
return locator.getService( RepositorySystem.class );
}
示例5: newRepositorySystem
import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
public 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( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
locator.setServices( WagonProvider.class, new ManualWagonProvider() );
return locator.getService( RepositorySystem.class );
}
示例6: build
import org.sonatype.aether.spi.connector.RepositoryConnectorFactory; //导入依赖的package包/类
/**
* Build it.
* @return The repo system.
*/
@Loggable(Loggable.DEBUG)
public RepositorySystem build() {
final DefaultServiceLocator locator = new DefaultServiceLocator();
locator.addService(
RepositoryConnectorFactory.class,
FileRepositoryConnectorFactory.class
);
locator.addService(
RepositoryConnectorFactory.class,
AsyncRepositoryConnectorFactory.class
);
locator.addService(
WagonProvider.class,
AmazonWagonProvider.class
);
locator.addService(
WagonConfigurator.class,
PlexusWagonConfigurator.class
);
locator.addService(
RepositoryConnectorFactory.class,
WagonRepositoryConnectorFactory.class
);
locator.addService(
RepositorySystem.class,
DefaultRepositorySystem.class
);
locator.addService(
VersionResolver.class,
DefaultVersionResolver.class
);
locator.addService(
VersionRangeResolver.class,
DefaultVersionRangeResolver.class
);
locator.addService(
ArtifactDescriptorReader.class,
DefaultArtifactDescriptorReader.class
);
final RepositorySystem system =
locator.getService(RepositorySystem.class);
if (system == null) {
throw new IllegalStateException("failed to get service");
}
return system;
}