• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SimpleLocalRepositoryManagerFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: noLocalRepositoryWhenNoGrapeRoot

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
@Test
public void noLocalRepositoryWhenNoGrapeRoot() {
	given(this.repositorySystem.newLocalRepositoryManager(eq(this.session),
			any(LocalRepository.class)))
					.willAnswer(new Answer<LocalRepositoryManager>() {

						@Override
						public LocalRepositoryManager answer(
								InvocationOnMock invocation) throws Throwable {
							LocalRepository localRepository = invocation
									.getArgumentAt(1, LocalRepository.class);
							return new SimpleLocalRepositoryManagerFactory()
									.newInstance(
											GrapeRootRepositorySystemSessionAutoConfigurationTests.this.session,
											localRepository);
						}

					});
	new GrapeRootRepositorySystemSessionAutoConfiguration().apply(this.session,
			this.repositorySystem);
	verify(this.repositorySystem, times(0))
			.newLocalRepositoryManager(eq(this.session), any(LocalRepository.class));
	assertThat(this.session.getLocalRepository()).isNull();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:25,代码来源:GrapeRootRepositorySystemSessionAutoConfigurationTests.java


示例2: applySettings

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
public static void applySettings(MavenSettings settings,
		DefaultRepositorySystemSession session) {
	if (settings.getLocalRepository() != null) {
		try {
			session.setLocalRepositoryManager(
					new SimpleLocalRepositoryManagerFactory().newInstance(session,
							new LocalRepository(settings.getLocalRepository())));
		}
		catch (NoLocalRepositoryManagerException e) {
			throw new IllegalStateException(
					"Cannot set local repository to " + settings.getLocalRepository(),
					e);
		}
	}
	session.setOffline(settings.getOffline());
	session.setMirrorSelector(settings.getMirrorSelector());
	session.setAuthenticationSelector(settings.getAuthenticationSelector());
	session.setProxySelector(settings.getProxySelector());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:20,代码来源:MavenSettingsReader.java


示例3: noLocalRepositoryWhenNoGrapeRoot

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
@Test
public void noLocalRepositoryWhenNoGrapeRoot() {
	given(this.repositorySystem.newLocalRepositoryManager(eq(this.session),
			any(LocalRepository.class)))
					.willAnswer(new Answer<LocalRepositoryManager>() {

						@Override
						public LocalRepositoryManager answer(
								InvocationOnMock invocation) throws Throwable {
							LocalRepository localRepository = invocation
									.getArgumentAt(1, LocalRepository.class);
							return new SimpleLocalRepositoryManagerFactory()
									.newInstance(
											GrapeRootRepositorySystemSessionAutoConfigurationTests.this.session,
											localRepository);
						}
					});

	new GrapeRootRepositorySystemSessionAutoConfiguration().apply(this.session,
			this.repositorySystem);

	verify(this.repositorySystem, times(0))
			.newLocalRepositoryManager(eq(this.session), any(LocalRepository.class));

	assertThat(this.session.getLocalRepository(), is(nullValue()));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:27,代码来源:GrapeRootRepositorySystemSessionAutoConfigurationTests.java


示例4: configure

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的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);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ExtensionModule.java


示例5: propertyInterpolation

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
@Test
public void propertyInterpolation() throws SettingsBuildingException {
	final DefaultRepositorySystemSession session = MavenRepositorySystemUtils
			.newSession();
	given(this.repositorySystem.newLocalRepositoryManager(eq(session),
			any(LocalRepository.class)))
					.willAnswer(new Answer<LocalRepositoryManager>() {

						@Override
						public LocalRepositoryManager answer(
								InvocationOnMock invocation) throws Throwable {
							LocalRepository localRepository = invocation
									.getArgumentAt(1, LocalRepository.class);
							return new SimpleLocalRepositoryManagerFactory()
									.newInstance(session, localRepository);
						}
					});

	SystemProperties.doWithSystemProperties(new Runnable() {
		@Override
		public void run() {
			new SettingsXmlRepositorySystemSessionAutoConfiguration().apply(session,
					SettingsXmlRepositorySystemSessionAutoConfigurationTests.this.repositorySystem);
		}
	}, "user.home:src/test/resources/maven-settings/property-interpolation",
			"foo:bar");

	assertThat(session.getLocalRepository().getBasedir().getAbsolutePath())
			.endsWith(File.separatorChar + "bar" + File.separatorChar + "repository");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:31,代码来源:SettingsXmlRepositorySystemSessionAutoConfigurationTests.java


示例6: answer

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
@Override
public LocalRepositoryManager answer(InvocationOnMock invocation)
		throws Throwable {
	LocalRepository localRepository = invocation.getArgumentAt(1,
			LocalRepository.class);
	return new SimpleLocalRepositoryManagerFactory().newInstance(
			GrapeRootRepositorySystemSessionAutoConfigurationTests.this.session,
			localRepository);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:GrapeRootRepositorySystemSessionAutoConfigurationTests.java


示例7: getMojo

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
private <M extends Mojo> M getMojo(String goal) throws Exception {
    File testBaseDir = new File(getClass().getResource("pom.xml").getFile()).getParentFile();
    Web2AppMojo mojo = (Web2AppMojo) rule.lookupConfiguredMojo(testBaseDir, goal);
    File localRepositoryFile = new File(testBaseDir, "repo");
    mojo.mavenProject.setRemoteArtifactRepositories(Arrays.asList(repository));
    DefaultRepositorySystemSession repositorySystemSession = (DefaultRepositorySystemSession) mojo.mavenSession.getRepositorySession();
    repositorySystemSession.setLocalRepositoryManager(
            new SimpleLocalRepositoryManagerFactory().newInstance(
                    repositorySystemSession, new LocalRepository(localRepositoryFile)));
    mojo.mavenSession.getRequest().setLocalRepository(new StubArtifactRepository(localRepositoryFile.getAbsolutePath()));
    return (M) mojo;
}
 
开发者ID:spirylics,项目名称:web2app,代码行数:13,代码来源:Web2AppMavenPluginTest.java


示例8: propertyInterpolation

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
@Test
public void propertyInterpolation() throws SettingsBuildingException {
	final DefaultRepositorySystemSession session = MavenRepositorySystemUtils
			.newSession();
	given(this.repositorySystem.newLocalRepositoryManager(eq(session),
			any(LocalRepository.class)))
					.willAnswer(new Answer<LocalRepositoryManager>() {

						@Override
						public LocalRepositoryManager answer(
								InvocationOnMock invocation) throws Throwable {
							LocalRepository localRepository = invocation
									.getArgumentAt(1, LocalRepository.class);
							return new SimpleLocalRepositoryManagerFactory()
									.newInstance(session, localRepository);
						}
					});

	SystemProperties.doWithSystemProperties(new Runnable() {
		@Override
		public void run() {
			new SettingsXmlRepositorySystemSessionAutoConfiguration().apply(session,
					SettingsXmlRepositorySystemSessionAutoConfigurationTests.this.repositorySystem);
		}
	}, "user.home:src/test/resources/maven-settings/property-interpolation",
			"foo:bar");

	assertThat(session.getLocalRepository().getBasedir().getAbsolutePath(),
			endsWith(File.separatorChar + "bar" + File.separatorChar + "repository"));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:31,代码来源:SettingsXmlRepositorySystemSessionAutoConfigurationTests.java


示例9: newMavenSession

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
protected MavenSession newMavenSession() {
    try {
        MavenExecutionRequest request = new DefaultMavenExecutionRequest();
        MavenExecutionResult result = new DefaultMavenExecutionResult();

        // populate sensible defaults, including repository basedir and remote repos
        MavenExecutionRequestPopulator populator;
        populator = getContainer().lookup( MavenExecutionRequestPopulator.class );
        populator.populateDefaults( request );

        // this is needed to allow java profiles to get resolved; i.e. avoid during project builds:
        // [ERROR] Failed to determine Java version for profile java-1.5-detected @ org.apache.commons:commons-parent:22, /Users/alex/.m2/repository/org/apache/commons/commons-parent/22/commons-parent-22.pom, line 909, column 14
        request.setSystemProperties( System.getProperties() );
        
        // and this is needed so that the repo session in the maven session 
        // has a repo manager, and it points at the local repo
        // (cf MavenRepositorySystemUtils.newSession() which is what is otherwise done)
        DefaultMaven maven = (DefaultMaven) getContainer().lookup( Maven.class );
        DefaultRepositorySystemSession repoSession =
            (DefaultRepositorySystemSession) maven.newRepositorySession( request );
        repoSession.setLocalRepositoryManager(
            new SimpleLocalRepositoryManagerFactory().newInstance(repoSession, 
                new LocalRepository( request.getLocalRepository().getBasedir() ) ));

        @SuppressWarnings("deprecation")
        MavenSession session = new MavenSession( getContainer(), 
            repoSession,
            request, result );
        return session;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:ahgittin,项目名称:license-audit-maven-plugin,代码行数:34,代码来源:BetterAbstractMojoTestCase.java


示例10: newMavenSession

import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; //导入依赖的package包/类
protected MavenSession newMavenSession() {
    try {
        MavenExecutionRequest request = new DefaultMavenExecutionRequest();
        MavenExecutionResult result = new DefaultMavenExecutionResult();

        // populate sensible defaults, including repository basedir and remote repos
        MavenExecutionRequestPopulator populator;
        populator = getContainer().lookup(MavenExecutionRequestPopulator.class);
        populator.populateDefaults(request);

        // this is needed to allow java profiles to get resolved; i.e. avoid during project builds:
        // [ERROR] Failed to determine Java version for profile java-1.5-detected @ org.apache.commons:commons-parent:22, /Users/alex/.m2/repository/org/apache/commons/commons-parent/22/commons-parent-22.pom, line 909, column 14
        request.setSystemProperties(System.getProperties());

        // and this is needed so that the repo session in the maven session
        // has a repo manager, and it points at the local repo
        // (cf MavenRepositorySystemUtils.newSession() which is what is otherwise done)
        DefaultMaven maven = (DefaultMaven) getContainer().lookup(Maven.class);
        DefaultRepositorySystemSession repoSession =
                (DefaultRepositorySystemSession) maven.newRepositorySession(request);
        repoSession.setLocalRepositoryManager(
                new SimpleLocalRepositoryManagerFactory().newInstance(repoSession,
                        new LocalRepository(request.getLocalRepository().getBasedir())));

        @SuppressWarnings("deprecation")
        MavenSession session = new MavenSession(getContainer(),
                repoSession,
                request, result);
        return session;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:walokra,项目名称:markdown-page-generator-plugin,代码行数:34,代码来源:BetterAbstractMojoTestCase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ObjectIntCursor类代码示例发布时间:2022-05-23
下一篇:
Java Scheme类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap