本文整理汇总了Java中org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory类的典型用法代码示例。如果您正苦于以下问题:Java LocalRepositoryManagerFactory类的具体用法?Java LocalRepositoryManagerFactory怎么用?Java LocalRepositoryManagerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocalRepositoryManagerFactory类属于org.eclipse.aether.spi.localrepo包,在下文中一共展示了LocalRepositoryManagerFactory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookupDelegate
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; //导入依赖的package包/类
/**
* Looks up the {@link LocalRepositoryManagerFactory} specified in {@link #preferedDelegateFactoryName}.
*
* @return the delegate factory
* @throws IllegalStateException
* if the {@link #preferedDelegateFactoryName} was not found in the list of available
* {@link LocalRepositoryManagerFactory} implementations.
*/
private LocalRepositoryManagerFactory lookupDelegate() {
Map<String, LocalRepositoryManagerFactory> factoryImpls = factories.get();
log.debug("SrcdepsRepositoryManagerFactory got {} LocalRepositoryManagerFactory instances",
factoryImpls.size());
for (Entry<String, LocalRepositoryManagerFactory> en : factoryImpls.entrySet()) {
LocalRepositoryManagerFactory factory = en.getValue();
log.debug("SrcdepsRepositoryManagerFactory iterating over LocalRepositoryManagerFactory {}: {}",
en.getKey(), factory.getClass().getName());
String factoryClassName = factory.getClass().getName();
if (factoryClassName.equals(preferedDelegateFactoryName)) {
log.info("SrcdepsLocalRepositoryManager will decorate {}", factoryClassName);
return factory;
}
}
throw new IllegalStateException(String.format(
"Could not find [%s] in the list of available LocalRepositoryManagerFactory implementations",
preferedDelegateFactoryName));
}
示例2: AetherResolver
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; //导入依赖的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);
}
示例3: newSession
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; //导入依赖的package包/类
private MavenSession newSession(MavenProject project, File localrepo, Properties properties) throws Exception {
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
MavenExecutionResult result = new DefaultMavenExecutionResult();
DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository(localrepo);
repoSession.setLocalRepositoryManager(mojos.getContainer().lookup(LocalRepositoryManagerFactory.class, "simple").newInstance(repoSession, localRepo));
MavenSession session = new MavenSession(mojos.getContainer(), repoSession, request, result);
List<MavenProject> projects = new ArrayList<>();
projects.add(project);
for (String module : project.getModules()) {
MavenProject moduleProject = readMavenProject(new File(project.getBasedir(), module), properties);
moduleProject.setParent(project);
projects.add(moduleProject);
}
session.setProjects(projects);
return session;
}
示例4: configure
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; //导入依赖的package包/类
@Override
public void configure(Binder binder) {
binder.bind(PluginDependenciesResolver.class).to(NbPluginDependenciesResolver.class);
binder.bind(Roles.componentKey(RepositoryConnectorFactory.class, "offline")).to(OfflineConnector.class);
//#212214 the EnhancedLocalRepositoryManager will claim artifact is not locally present even if file is there but some metadata is missing
//we just replace it with the simple variant that relies on file's presence only.
//I'm a bit afraid to remove the binding altogether, that's why we map simple to enhanced.
binder.bind(Roles.componentKey(LocalRepositoryManagerFactory.class, "enhanced")).to(SimpleLocalRepositoryManagerFactory.class);
//exxperimental only.
// binder.bind(InheritanceAssembler.class).to(NbInheritanceAssembler.class);
binder.bind(ModelBuilder.class).to(NBModelBuilder.class);
}
示例5: newInstance
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; //导入依赖的package包/类
/**
* Looks up the delegate using {@link #lookupDelegate()}, calls
* {@link SrcdepsRepositoryManagerFactory#newInstance(RepositorySystemSession, LocalRepository)} on the delegate
* producing a delegate {@link LocalRepositoryManager} that is passed to
* {@link SrcdepsLocalRepositoryManager#SrcdepsLocalRepositoryManager(LocalRepositoryManager, Provider, BuildService)}.
* The new {@link SrcdepsLocalRepositoryManager} instance is then returned.
*
* @see org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory#newInstance(org.eclipse.aether.RepositorySystemSession,
* org.eclipse.aether.repository.LocalRepository)
*/
@Override
public LocalRepositoryManager newInstance(RepositorySystemSession session, LocalRepository repository)
throws NoLocalRepositoryManagerException {
LocalRepositoryManagerFactory delegate = lookupDelegate();
log.debug("Creating a new SrcdepsLocalRepositoryManager");
return new SrcdepsLocalRepositoryManager(delegate.newInstance(session, repository), buildService, pathLocker, configurationProducer);
}