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


Java MavenResolverSystem类代码示例

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


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

示例1: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    MavenResolverSystem mavenResolver = Resolvers.use(MavenResolverSystem.class);
    List<String> deps = asList(
            "org.hawkular.metrics:hawkular-metrics-model:" + System.getProperty("version.org.hawkular.metrics"),
            "org.hawkular.metrics:hawkular-metrics-api-util:" + System.getProperty("version.org.hawkular.metrics"),
            "org.hawkular.metrics:hawkular-metrics-alerting:" + System.getProperty("version.org.hawkular.metrics"),
            "org.hawkular.alerts:hawkular-alerts-api:" + System.getProperty("version.org.hawkular.alerts"),
            "org.hawkular.alerts:hawkular-alerts-filter-api:" + System.getProperty("version.org.hawkular.alerts"),
            "io.reactivex:rxjava:" + System.getProperty("version.io.reactivex.rxjava"));

    Collection<JavaArchive> dependencies = new HashSet<JavaArchive>();
    dependencies.addAll(asList(mavenResolver.loadPomFromFile("pom.xml").resolve(deps)
            .withoutTransitivity().as(JavaArchive.class)));

    WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addPackages(true, "org.hawkular.alerts.api.services")
            .addAsLibraries(dependencies)
            .addClass(ConfigurableProducer.class)
            .addAsWebInfResource(new File("src/test/resources/web.xml"))
            .addAsWebInfResource(new File("src/test/resources/jboss-deployment-structure.xml"))
            .setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: com.google.guava\n"));

    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-metrics,代码行数:26,代码来源:PublishDataPointsTest.java

示例2: obtainBomDependencies

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
protected Set<MavenDependency> obtainBomDependencies(String urlLocation) throws IOException, MojoExecutionException {
    ArtifactResult artifact = downloadAndInstallArtifact(urlLocation);
    File file = artifact.getArtifact().getFile();

    MavenResolverSystem resolver = Maven.resolver();
    resolver.loadPomFromFile(file).importCompileAndRuntimeDependencies();
    MavenWorkingSession session =((MavenWorkingSessionContainer)resolver).getMavenWorkingSession();

    return session.getDependencyManagement();
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:11,代码来源:RepackageExtensionMojo.java

示例3: getTestDeployment

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
/**
 * Test hooks so we can do some cleanupCreatedProject
 *
 * @return
 */
static WebArchive getTestDeployment() {
    final WebArchive archive = ShrinkWrap.create(WebArchive.class, "test.war")
            .addPackages(
                    true,
                    OpenShiftServiceSpi.class.getPackage(),
                    OpenShiftProjectImpl.class.getPackage(),
                    OpenShiftServiceFactory.class.getPackage(),
                    GitHubServiceSpi.class.getPackage(),
                    KohsukeGitHubServiceImpl.class.getPackage(),
                    GitHubServiceFactory.class.getPackage())
            .addPackage(TestSupport.class.getPackage());
    final File[] depsOpenshift = Resolvers.use(MavenResolverSystem.class).
            loadPomFromFile("../services/openshift-service-impl/pom.xml").
            importRuntimeAndTestDependencies().
            resolve().
            withTransitivity().
            asFile();
    final File[] depsGithub = Resolvers.use(MavenResolverSystem.class).
            loadPomFromFile("../services/github-service-impl/pom.xml").
            importRuntimeAndTestDependencies().
            resolve().
            withTransitivity().
            asFile();

    final File[] ourTestDeps = Resolvers.use(MavenResolverSystem.class).
            loadPomFromFile("pom.xml").
            importTestDependencies().
            resolve().
            withTransitivity().
            asFile();
    archive.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    archive.addAsLibraries(depsOpenshift);
    archive.addAsLibraries(depsGithub);
    archive.addAsLibraries(ourTestDeps);
    return archive;
}
 
开发者ID:fabric8-launcher,项目名称:launchpad-missioncontrol,代码行数:42,代码来源:Deployments.java

示例4: deployment

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
@Deployment
public static Archive<?> deployment() {
	WebArchive war = Deployments.getBaseDeployment();

	MavenResolverSystem resolver = Maven.resolver();
	war.addAsLibraries(resolver.loadPomFromFile("pom.xml")
			.resolve("com.jayway.restassured:rest-assured")
			.withTransitivity().asFile());

	System.out.println(war.toString(true));
	return war;
}
 
开发者ID:ecabrerar,项目名称:AirAlliance,代码行数:13,代码来源:SectorRestServiceTest.java

示例5: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    MavenResolverSystem resolver = Maven.resolver();
    WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "viewscopedbean.war")
            .setWebXML(new File(WEBAPP_SRC, "WEB-INF/web.xml"))
            .addClass(ViewScopedBean.class)
            .addAsLibraries(resolver.loadPomFromFile("pom.xml").resolve("org.primefaces:primefaces:5.1").withoutTransitivity().asFile())
            .addAsWebResource(new File(WEBAPP_SRC, "index.xhtml"))
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    System.out.println(webArchive.toString(true));
    return webArchive;
}
 
开发者ID:cilf,项目名称:arquillian-java-ee-7-primefaces-5,代码行数:13,代码来源:ViewScopedBeanTest.java

示例6: war

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
@Deployment
public static Archive<?> war() {
    final MavenResolverSystem resolver = Maven.resolver();
    final String jerseyVersion = "2.17";
    final String hkApi = "2.4.0-b16";
    return ShrinkWrap.create(WebArchive.class, "OverridedClientTest.war")
            .addAsServiceProvider(ClientBuilder.class.getName(), "org.glassfish.jersey.client.JerseyClientBuilder") // missing in jersey
            .addAsLibraries(resolver.resolve("org.glassfish.jersey.core:jersey-common:" + jerseyVersion).withoutTransitivity().asFile())
            .addAsLibraries(resolver.resolve("org.glassfish.jersey.core:jersey-client:" + jerseyVersion).withoutTransitivity().asFile())
            .addAsLibraries(resolver.resolve("org.glassfish.hk2:hk2-api:" + hkApi).withoutTransitivity().asFile())
            .addAsLibraries(resolver.resolve("org.glassfish.hk2:hk2-core:" + hkApi).withoutTransitivity().asFile())
            .addAsLibraries(resolver.resolve("org.glassfish.jersey.bundles.repackaged:jersey-guava:" + jerseyVersion).withoutTransitivity().asFile());
}
 
开发者ID:apache,项目名称:tomee,代码行数:14,代码来源:OverridedClientTest.java

示例7: getResolver

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
private static MavenResolverSystem getResolver() {
  return Maven.resolver();
}
 
开发者ID:Qorr,项目名称:Hvalspik,代码行数:4,代码来源:MavenDeployables.java

示例8: setupPortalMinimal

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
protected static void setupPortalMinimal() {
	System.setProperty("liferay.version", LIFERAY_VERSION);

	System.setProperty("liferay.auto.deploy.dir", PORTAL_AUTO_DEPLOY_DIR);

	System.setProperty(
		"liferay.app.server.deploy.dir", PORTAL_SERVER_DEPLOY_DIR);

	System.setProperty(
		"liferay.app.server.lib.global.dir", PORTAL_SERVER_LIB_GLOBAL_DIR);

	System.setProperty("liferay.app.server.portal.dir", SERVER_PORTAL_DIR);

	try {
		ArchiverManager archiverManager = plexusContainer.lookup(
			ArchiverManager.class);

		assertNotNull(archiverManager);

		FileUtils.forceMkdir(new File(PORTAL_AUTO_DEPLOY_DIR));
		FileUtils.forceMkdir(new File(PORTAL_SERVER_DEPLOY_DIR));
		FileUtils.forceMkdir(new File(PORTAL_SERVER_LIB_GLOBAL_DIR));
		FileUtils.forceMkdir(new File(SERVER_PORTAL_DIR));

		final MavenResolverSystem mavenResolverSystem =
			Maven.configureResolver().fromClassloaderResource(
				"settings.xml");

		File[] dependencies =
			mavenResolverSystem.loadPomFromClassLoaderResource(
				"liferay-setup.xml").importRuntimeAndTestDependencies().
				resolve().withoutTransitivity().asFile();

		File warFile = null;

		for (File file : dependencies) {
			String fileName = file.getName();
			String fileExtension = FilenameUtils.getExtension(fileName);

			if (fileExtension.equalsIgnoreCase("jar")) {
				FileUtils.copyFile(
					file, new File(PORTAL_SERVER_LIB_GLOBAL_DIR,
					file.getName()));
			}
			else if (fileExtension.equalsIgnoreCase("war") &&
					 fileName.contains("portal-web")) {

				warFile = file;
			}
		}

		assertNotNull(warFile);

		// extract portal war

		UnArchiver unArchiver = archiverManager.getUnArchiver(warFile);
		unArchiver.setDestDirectory(new File(SERVER_PORTAL_DIR));
		unArchiver.setSourceFile(warFile);
		unArchiver.setOverwrite(false);
		unArchiver.extract();
		setup = true;
	}
	catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:67,代码来源:LiferayPluginTestCase.java

示例9: build

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
public WebArchive build(JavaArchive... archives) {
	if(LOGGER.isDebugEnabled() &&
		Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.setup"))) {
		LOGGER.debug("Creating testing web application archive:");
		LOGGER.debug("- Maven configuration:");
		LOGGER.debug("  + Setting: "+getSettings());
		LOGGER.debug("  + POM....: "+getPom());
		LOGGER.debug("- Web application configuration:");
		LOGGER.debug("  + Descriptor.....: "+getWebXml());
		LOGGER.debug("  + Deployable name: "+getDeployableName());
		LOGGER.debug("  + Control phrase.: "+getControlPhrase());
		if(archives.length>0) {
			LOGGER.debug("- Custom libraries:");
			for(JavaArchive archive:archives) {
				LOGGER.debug("  + "+archive);
				if(LOGGER.isTraceEnabled() &&
					Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.setup")) &&
					Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.archive"))) {
					LOGGER.trace(archive.toString(true));
				}
			}
		}
	}

	MavenResolverSystem resolver = Maven.
		configureResolver().fromClassloaderResource(getSettings());
	PomEquippedResolveStage mavenResolver=
		resolver.loadPomFromClassLoaderResource(getPom());

	WebArchive war=
		ShrinkWrap.
			create(WebArchive.class, getDeployableName()).
			addAsLibraries(
				mavenResolver.
					importRuntimeDependencies().asFile()).
			addAsLibraries(archives).
			addAsWebResource(
				new StringAsset(getControlPhrase()),"index.html");

	updateWebInf(war);

	if(LOGGER.isTraceEnabled() &&
		Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.setup")) &&
		Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.archive"))) {
		LOGGER.trace(String.format("Testing web application archive: \n%s",war.toString(true)));
	}

	return war;
}
 
开发者ID:ldp4j,项目名称:ldp4j,代码行数:50,代码来源:ServerFrontendWebAppBuilder.java

示例10: deployment

import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem; //导入依赖的package包/类
@Deployment
  public static Archive<?> deployment() {

  	MavenResolverSystem resolver = Maven.resolver();

WebArchive war = Deployments.getBaseDeployment();

war.addAsLibraries(resolver.loadPomFromFile("pom.xml")
					.resolve("com.jayway.restassured:rest-assured").withTransitivity().asFile());

System.out.println(war.toString(true));

return war;
  }
 
开发者ID:ecabrerar,项目名称:AirAlliance,代码行数:15,代码来源:ItineraryRestServiceTest.java


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