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


Java WARArchive.addAllDependencies方法代码示例

本文整理汇总了Java中org.wildfly.swarm.undertow.WARArchive.addAllDependencies方法的典型用法代码示例。如果您正苦于以下问题:Java WARArchive.addAllDependencies方法的具体用法?Java WARArchive.addAllDependencies怎么用?Java WARArchive.addAllDependencies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.wildfly.swarm.undertow.WARArchive的用法示例。


在下文中一共展示了WARArchive.addAllDependencies方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    // Instantiate the container
    Swarm swarm = new Swarm(args);

    // Create one or more deployments
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);

    // Add resource to deployment
    deployment.addPackage(Main.class.getPackage());
    deployment.addAllDependencies();

    // Add Web resources
    deployment.addAsWebResource(
            new ClassLoaderAsset("src/main/webapp/index.html", Main.class.getClassLoader()), "src/main/webapp/index.html");
    deployment.addAsWebInfResource(
            new ClassLoaderAsset("src/main/webapp/WEB-INF/beans.xml", Main.class.getClassLoader()), "beans.xml");


    swarm.start().deploy(deployment);

}
 
开发者ID:xstefank,项目名称:lra-service,代码行数:22,代码来源:Main.java

示例2: deployApp

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
private void deployApp() throws Exception {
    WARArchive appDeployment = ShrinkWrap.create(WARArchive.class, "tubewarder.war");
    appDeployment.addPackages(true, "net.weweave.tubewarder");
    appDeployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence-"+getConfig().getDb()+".xml", TubewarderSwarm.class.getClassLoader()), "classes/META-INF/persistence.xml");
    if ("postgresql".equals(getConfig().getDb())) {
        appDeployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/" + getConfig().getDb() + "-mapping.xml", TubewarderSwarm.class.getClassLoader()), "classes/META-INF/postgresql-mapping.xml");
    }

    File[] libs = getAdditionalJars();
    for (File lib : libs) {
        appDeployment.addAsLibrary(lib, lib.getName());
    }

    appDeployment.addAllDependencies();
    appDeployment.staticContent();
    deploy(appDeployment);
}
 
开发者ID:weweave,项目名称:tubewarder,代码行数:18,代码来源:TubewarderSwarm.java

示例3: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);
    deployment.addPackage("pro.taskana");
    deployment.addClass(TaskanaProducers.class);
    deployment.addAllDependencies();
    deployment.addDependency("org.mybatis:mybatis:3.4.2");
    deployment.addDependency("org.mybatis:mybatis-cdi:1.0.0");
    deployment.addDependency("pro.taskana:taskana-core:0.0.5-SNAPSHOT");
    deployment.addAsResource("META-INF/beans.xml");
    deployment.addAsResource("taskana.properties");
    deployment.addAsResource("project-defaults.yml");
    return deployment;
}
 
开发者ID:Taskana,项目名称:taskana,代码行数:15,代码来源:TaskanaProducersTest.java

示例4: main

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
/**
 * @param args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
    // Instantiate the container
    Swarm swarm = new Swarm(args);

    // Create one or more deployments
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);

    // Add resource to deployment
    deployment.addPackage(Main.class.getPackage());
    deployment.addAllDependencies();

    // Add Web resources
    deployment.addAsWebResource(
        new ClassLoaderAsset("index.html", Main.class.getClassLoader()), "index.html");
    deployment.addAsWebInfResource(
        new ClassLoaderAsset("WEB-INF/web.xml", Main.class.getClassLoader()), "web.xml");
    deployment.addAsWebInfResource(
        new ClassLoaderAsset("WEB-INF/beans.xml", Main.class.getClassLoader()), "beans.xml");

    // If There's a KEYCLOAK_SERVER_URL env var, then read the file
    if (System.getenv("KEYCLOAK_AUTH_SERVER_URL") != null) {
        deployment.addAsWebInfResource(
            new ClassLoaderAsset("keycloak.json", Main.class.getClassLoader()), "keycloak.json");
    }

    swarm.start().deploy(deployment);

}
 
开发者ID:redhat-helloworld-msa,项目名称:hola,代码行数:33,代码来源:Main.java

示例5: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    WARArchive archive = ShrinkWrap.create(WARArchive.class, "SampleTest.war");
    archive.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    archive.addPackage("example");
    archive.addAllDependencies();
    return archive;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:9,代码来源:SampleTest.java

示例6: main

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	Container container = new Container();

	container.fraction(new DatasourcesFraction().jdbcDriver("h2", (d) -> {
		d.driverDatasourceClassName("org.h2.Driver");
		d.xaDatasourceClass("org.h2.jdbcx.JdbcDataSource");
		d.driverModuleName("com.h2database.h2");
	}).dataSource("ExampleDS", (ds) -> {
		ds.driverName("h2");
		ds.connectionUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE");
		ds.userName("sa");
		ds.password("sa");
	}));

	container.fraction(new JPAFraction().inhibitDefaultDatasource().defaultDatasource("jboss/datasources/ExampleDS"));

	container.start();

	WARArchive deployment = ShrinkWrap.create(WARArchive.class);
	deployment.addClasses(BlogEntryDao.class, BlogEntryQueryImpl.class, BlogEntry.class);
	deployment.addPackage(BlogEntryBean.class.getPackage());
	deployment.addAllDependencies();

	deployment.addAsWebResource(new ClassLoaderAsset("index.xhtml", Main.class.getClassLoader()), "index.xhtml");

	deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml", Main.class.getClassLoader()),
			"classes/META-INF/persistence.xml");
	deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/load.sql", Main.class.getClassLoader()), "classes/META-INF/load.sql");
	deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/beans.xml", Main.class.getClassLoader()), "classes/META-INF/beans.xml");

	container.deploy(deployment);
}
 
开发者ID:aracrown,项目名称:ara-blog-examples,代码行数:33,代码来源:Main.java


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