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


Java SimpleLocalRepositoryManagerFactory类代码示例

本文整理汇总了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;未经允许,请勿转载。