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

Java MavenImporter类代码示例

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

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



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

示例1: startProcessJar

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
/**
 * Start the cli process
 */
@Test
public void startProcessJar() throws Exception {
    String jarName = String.format("target%stest.jar", File.separator);
    String java = System.getProperty("java.home") + Config.getPathSeparator() + "bin" + Config.getPathSeparator() + "java";

    JavaArchive archive = ShrinkWrap.create(MavenImporter.class).loadPomFromFile("pom.xml").importBuildOutput().importBuildOutput().as(JavaArchive.class);
    archive.addAsManifestResource(new StringAsset(String.format("Manifest-Version: 1.0\n" + "Main-Class: %s\n", SimpleTestExample.class.getCanonicalName())), "MANIFEST.MF");
    archive.addClass(SimpleTestExample.class);
    File fileArchive = new File(jarName);
    archive.as(ZipExporter.class).exportTo(fileArchive, true);


    ProcessBuilder pb = new ProcessBuilder(
            java,
            "-jar",
            jarName);
    testReadlineByProcessBuilder(pb);
}
 
开发者ID:aeshell,项目名称:aesh-readline,代码行数:22,代码来源:TestReadlineInSeparateProcess.java


示例2: deployment

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

    File[] filesCompile = Maven.resolver().loadPomFromFile("pom.xml").importDependencies(ScopeType.COMPILE).resolve().withTransitivity().asFile();
    File[] filestest = Maven.resolver().loadPomFromFile("pom.xml")
            .resolve("com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-databind", "com.fasterxml.jackson.core:jackson-core").withTransitivity().asFile();

    JavaArchive jar = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    WebArchive war = ShrinkWrap.create(WebArchive.class)
            .addAsLibraries(filestest)
            .addAsLibraries(jar)
            .addAsLibraries(filesCompile)
            .addClasses(UserDefaultExample.class, UserRepositoryExample.class)
            .addClasses(JAXRSConfigurationExample.class, ObjectMapperProviderExample.class, ResourceExample.class)
            .addAsWebInfResource("WEB-INF/test.shiro.ini", "shiro.ini")
            .addAsWebInfResource("WEB-INF/web.xml", "web.xml")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

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

    return war;
}
 
开发者ID:panchitoboy,项目名称:shiro-jwt,代码行数:27,代码来源:JWTOrFormAuthenticationFilterTest.java


示例3: createTestArchive1

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(name = "as-maven-importer", order = 1)
@TargetsContainer("arquillian-wildfly-managed-1")
@OverProtocol("Servlet 3.0")
public static Archive<?> createTestArchive1() {
    /* unfortunately your test dependencies must be listed here */
    File[] assertJ = Maven.resolver()
            .loadPomFromFile("pom.xml")
            .resolve("org.assertj:assertj-core")
            .withTransitivity()
            .asFile();

    // important:: the deployment name is taken as artifact file name
    // because we have two deployments we should rename one deployment to "customized-webcontent.war"
    return create(MavenImporter.class, "customized-webcontent.war")
            .loadPomFromFile("pom.xml")
            .importBuildOutput(/*Do NOT use due to creates very big WAR new AcceptScopesStrategy(COMPILE, IMPORT, RUNTIME, TEST)*/)
            .as(WebArchive.class)
            .addAsLibraries(assertJ)
            .addClass(TestDataCreator.class)
            .addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new File(getProperty("web.xml")), "web.xml");
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:24,代码来源:DummyIT.java


示例4: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    File file = findPomFile();
    return ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile(file)
            .importBuildOutput()
            .as(WebArchive.class);
}
 
开发者ID:kiegroup,项目名称:optashift-employee-rostering,代码行数:9,代码来源:AbstractClientArquillianTest.java


示例5: createGuardedMethodDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(managed = false, name = "FAILING_GUARDED_METHOD")
public static WebArchive createGuardedMethodDeployment() {

    final JavaArchive as = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(as)
            .addClass(IncorrectFailsafeMethodContractBean.class)
            .addAsWebInfResource("beans.xml");
}
 
开发者ID:Pscheidl,项目名称:FortEE,代码行数:14,代码来源:FortExtensionTest.java


示例6: createGuardedBeanDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(managed = false, name = "FAILING_GUARDED_BEAN")
public static WebArchive createGuardedBeanDeployment() {

    final JavaArchive as = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(as)
            .addClass(OneMethodWithIncorrectFailsafeContractBean.class)
            .addAsWebInfResource("beans.xml");
}
 
开发者ID:Pscheidl,项目名称:FortEE,代码行数:14,代码来源:FortExtensionTest.java


示例7: createSemiGuardedMethodDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(managed = false, name = "FAILING_SEMI_GUARDED_METHOD")
public static WebArchive createSemiGuardedMethodDeployment() {

    final JavaArchive as = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(as)
            .addClass(IncorrectSemisafeMethodContractBean.class)
            .addAsWebInfResource("beans.xml");
}
 
开发者ID:Pscheidl,项目名称:FortEE,代码行数:14,代码来源:FortExtensionTest.java


示例8: createSemiGuardedBeanDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(managed = false, name = "FAILING_SEMI_GUARDED_BEAN")
public static WebArchive createSemiGuardedBeanDeployment() {

    final JavaArchive as = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(as)
            .addClass(OneMethodWithIncorrectSemisafeContractBean.class)
            .addAsWebInfResource("beans.xml");
}
 
开发者ID:Pscheidl,项目名称:FortEE,代码行数:14,代码来源:FortExtensionTest.java


示例9: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {

    final JavaArchive as = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(as)
            .addClass(ExceptionUtils.class)
            .addClass(SemiGuardedBean.class)
            .addAsWebInfResource("beans.xml");
}
 
开发者ID:Pscheidl,项目名称:FortEE,代码行数:15,代码来源:SemisafeInterceptorTest.java


示例10: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {

    final JavaArchive as = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(as)
            .addClass(FailingBean.class)
            .addClass(NotFailingBean.class)
            .addAsWebInfResource("beans.xml");
}
 
开发者ID:Pscheidl,项目名称:FortEE,代码行数:15,代码来源:FailsafeInterceptorTest.java


示例11: createTestArchive

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment
@OverProtocol("Servlet 3.0")
public static Archive<?> createTestArchive() {
    return create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new File(getProperty("web.xml")), "web.xml");
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:11,代码来源:DummyIT.java


示例12: createTestArchive

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment
@OverProtocol("Servlet 3.0")
public static Archive<?> createTestArchive() {
    return create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new File(getProperty("web.xml")), "web.xml")
            .addAsWebInfResource(new File(getProperty("jboss-web.xml")), "jboss-web.xml");
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:12,代码来源:JmsIT.java


示例13: createTestArchive

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(name = "FunctionalIT-shouldFindTimerTicks")
@OverProtocol("Servlet 3.0")
public static Archive<?> createTestArchive() {
    //ShrinkWrap.create(MavenImporter.class).configureFromFile("/path/to/settings.xml").loadPomFromFile("/path/to/pom.xml").importBuildOutput().as(JavaArchive.class)
    /*File[] libs = *///ShrinkWrap.create(MavenImporter.class).loadPomFromFile("pom.xml").importBuildOutput().as(WebArchiveImpl.class);resolve().withTransitivity().asFile();

    return create(MavenImporter.class)
            //.configureFromFile("/path/to/settings.xml")
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(WebArchive.class)
            .addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new File(getProperty("web.xml")), "web.xml")
            .addAsResource(new StringAsset("Manifest-Version: 1.0\r\n" +
                            "Dependencies: org.apache.commons.collections export, org.apache.commons.lang export"),
                    "META-INF/MANIFEST.MF");

    /*File[] libs = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeAndTestDependencies().resolve().withTransitivity().asFile();
    WebArchive res = ShrinkWrap.create(WebArchive.class, "test.war");
    res.addClass(A.class);
    return res.addAsLibraries(libs);*/

    /*return ShrinkWrap
            .create(WebArchive.class, *//*HikeRepositoryIT.class.getSimpleName() + *//*"test.war")
            *//*.addPackage( Hike.class.getPackage() )
            .addPackage( HikeRepository.class.getPackage() )
            .addAsResource( "META-INF/persistence.xml" )
            .addAsWebInfResource( new File( WEBAPP_SRC + "WEB-INF/beans.xml" ) )
            .addAsResource( new StringAsset(
                            "Dependencies: org.hibernate:ogm services, org.hibernate.ogm.mongodb services" ),
                    "META-INF/MANIFEST.MF"
            )*//*;*/
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:35,代码来源:FunctionalIT.java


示例14: createTestArchive

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(name = "FunctionalIT-shouldFindTimerTicks")
@OverProtocol("Servlet 3.0")
public static Archive<?> createTestArchive() {
    return create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(WebArchive.class)
            .addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new File(getProperty("web.xml")), "web.xml")
            .addAsResource(new StringAsset("Manifest-Version: 1.0\r\n" +
                            "Dependencies: org.apache.commons.collections export, org.apache.commons.lang export"),
                    "META-INF/MANIFEST.MF");
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:15,代码来源:FunctionalIT.java


示例15: doImport

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
private WebArchive doImport(String pomFile) {
	try {

		// When

		WebArchive archive =
			ShrinkWrap.create(MavenImporter.class).loadPomFromFile(pomFile).
				importBuildOutput().as(WebArchive.class);

		return archive;
	}
	catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:16,代码来源:LiferayPortletMavenImporterTestCase.java


示例16: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
/**
 * Method for creating and deploying the war file from 'jaxws-endpoint' project,
 * which contains the web service to be tested.
 *
 * @return a war file
 */
@Deployment(testable = false)
public static WebArchive createDeployment() {
    return ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("../jaxws-endpoint/pom.xml")
            .importBuildOutput()  
            .as(WebArchive.class);
}
 
开发者ID:ftomassetti,项目名称:JavaIncrementalParser,代码行数:14,代码来源:EBookStoreClientSampleTest.java


示例17: deployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment(testable = true)
public static WebArchive deployment() {
    return ShrinkWrap.create(MavenImporter.class).loadPomFromFile("pom.xml").importBuildOutput().as(WebArchive.class);
}
 
开发者ID:packt-wildfly,项目名称:packt-java-ee-7-code-samples,代码行数:5,代码来源:SeatsResourceTest.java


示例18: createTestArchive

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
@Deployment
public static Archive<?> createTestArchive() {
    return ShrinkWrap.create(MavenImporter.class).loadPomFromFile("pom.xml").importBuildOutput()
        .as(WebArchive.class);
}
 
开发者ID:packt-wildfly,项目名称:packt-java-ee-7-code-samples,代码行数:6,代码来源:TicketServiceTest.java


示例19: createLiferayPluginDeployment

import org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporter; //导入依赖的package包/类
private DeploymentDescription createLiferayPluginDeployment() {
	log.debug("Building Liferay Plugin from project pom.xml");

	File pomFile = new File("pom.xml");

	if ((pomFile != null) && pomFile.exists()) {
		log.debug(
			"Loading project from pom file:" + pomFile.getAbsolutePath());

		String globalSettings = System.getProperty(
			"maven.execution.global-settings");

		String userSettings = System.getProperty(
			"maven.execution.user-settings");

		String profilesString = System.getProperty(
			"maven.execution.active-profiles");

		PomlessMavenImporter mavenImporter = ShrinkWrap.create(
			MavenImporter.class);

		if (globalSettings != null) {
			mavenImporter =
				((MavenImporter)mavenImporter).configureFromFile(
					globalSettings);
		}

		if (userSettings != null) {
			mavenImporter =
				((MavenImporter)mavenImporter).configureFromFile(
					userSettings);
		}

		String[] profiles = new String[0];

		if (profilesString != null) {
			profiles = profilesString.split(",");
		}

		WebArchive archive = mavenImporter.loadPomFromFile(
			pomFile, profiles).importBuildOutput().as(WebArchive.class);

		DeploymentDescription deploymentDescription =
			new DeploymentDescription("_DEFAULT", archive);

		deploymentDescription.shouldBeTestable(true);

		return deploymentDescription;
	}

	return null;
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:53,代码来源:MavenDeploymentScenarioGenerator.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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