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

Java WARArchive类代码示例

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

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



WARArchive类属于org.wildfly.swarm.undertow包,在下文中一共展示了WARArchive类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: getImplicitDeployments

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Override
public List<Archive> getImplicitDeployments(TopologyWebAppFraction fraction) throws Exception {
    String context = System.getProperty(TopologyProperties.CONTEXT_PATH);
    if (context == null) context = DEFAULT_CONTEXT;

    List<Archive> list = new ArrayList<>();
    if (fraction.exposeTopologyEndpoint()) {
        WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
        war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
        war.addClass(TopologySSEServlet.class);
        war.addModule("swarm.application");
        war.addModule("org.wildfly.swarm.topology");
        war.addAsWebResource(new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
        war.setContextRoot(context);
        war.as(TopologyArchive.class);
        list.add(war);
    }
    return list;
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology,代码行数:20,代码来源:TopologyWebAppConfiguration.java


示例3: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);

    // on real world deployments, these parts would come from a dependency of the target application
    deployment.addClass(MockTracerResolver.class);
    deployment.addPackage(MockTracer.class.getPackage());
    deployment.addAsServiceProvider(TracerResolver.class, MockTracerResolver.class);

    // this is a simple servlet, that we can hit with our tests
    deployment.addClass(SimpleServlet.class);
    deployment.addClass(HealthServlet.class);
    deployment.addAsResource("project-skip-pattern.yml");

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:SkipPatternTest.java


示例4: process

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Override
public void process() {
    if (archive.getName().endsWith(".war")) {
        WARArchive webArchive = archive.as(WARArchive.class);
        WebXmlAsset webXml = webArchive.findWebXmlAsset();
        webXml.addListener("org.wildfly.swarm.flyway.deployment.FlywayMigrationServletContextListener");
        FlywayFraction flywayFraction = flywayFractionInstance.get();
        if (flywayFraction.usePrimaryDataSource()) {
            String dataSourceJndi = getDatasourceNameJndi();
            webXml.setContextParam(FlywayMigrationServletContextListener.FLYWAY_JNDI_DATASOURCE, dataSourceJndi);
        } else {
            webXml.setContextParam(FlywayMigrationServletContextListener.FLYWAY_JDBC_URL, flywayFraction.jdbcUrl());
            webXml.setContextParam(FlywayMigrationServletContextListener.FLYWAY_JDBC_USER, flywayFraction.jdbcUser());
            webXml.setContextParam(FlywayMigrationServletContextListener.FLYWAY_JDBC_PASSWORD, flywayFraction.jdbcPassword());
        }
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:18,代码来源:FlywayMigrationArchivePreparer.java


示例5: deployment

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Produces
@Dependent()
Archive deployment() {

    String context = TopologyWebAppFraction.DEFAULT_CONTEXT;
    if (this.contextPath != null) {
        context = this.contextPath;
    }

    if (fraction.exposeTopologyEndpoint()) {
        WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
        war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
        war.addClass(TopologySSEServlet.class);
        war.addModule("swarm.application");
        war.addModule("org.wildfly.swarm.topology");
        war.addAsWebResource(new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
        war.setContextRoot(context);
        war.as(TopologyArchive.class);
        return war;
    }
    return null;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:23,代码来源:TopologyWebAppDeploymentProducer.java


示例6: jolokiaWar

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Produces
public Archive jolokiaWar() throws Exception {

    if (this.context == null) {
        this.context = this.fraction.context();
    }

    Archive deployment = this.lookup.artifact(DEPLOYMENT_GAV, DEPLOYMENT_NAME);

    deployment.as(WARArchive.class).setContextRoot(this.context);

    Consumer<Archive> preparer = new ConfigurationValueAccessPreparer(this.jolokiaAccessXML);
    if (this.fraction.jolokiaWarPreparer() != null) {
        preparer = preparer.andThen(this.fraction.jolokiaWarPreparer());
    }

    preparer.accept(deployment);

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:21,代码来源:JolokiaWarDeploymentProducer.java


示例7: 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


示例8: getImplicitDeployments

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Override
public List<Archive> getImplicitDeployments(SwaggerWebAppFraction fraction) throws Exception {
    List<Archive> list = new ArrayList<>();
    try {
        // Get the swagger-ui bits as an Archive
        WARArchive war = Swarm.artifact("org.wildfly.swarm:swagger-webapp-ui:war:" + Container.VERSION,
                "swagger-webapp-ui.war")
                .as(WARArchive.class)
                .setContextRoot(fraction.getContext());

        // If any user content has been provided, merge that with the swagger-ui bits
        Archive<?> userContent = fraction.getWebContent();
        if (userContent != null) {
            war.merge(userContent);
        }
        //war.as(ZipExporter.class).exportTo(new File("swagger-webapp-ui.war"), true);
        list.add(war);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return list;
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:23,代码来源:SwaggerWebAppConfiguration.java


示例9: getImplicitDeployments

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Override
public List<Archive> getImplicitDeployments(TopologyWebAppFraction fraction) throws Exception {
    String context = System.getProperty(TopologyProperties.CONTEXT_PATH);
    if (context == null) context = DEFAULT_CONTEXT;

    List<Archive> list = new ArrayList<>();
    WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
    war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
    war.addClass(TopologySSEServlet.class);
    war.addModule("swarm.application");
    war.addModule("org.wildfly.swarm.topology");
    war.addAsWebResource(new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
    war.setContextRoot(context);
    war.as(TopologyArchive.class);
    list.add(war);
    return list;
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:18,代码来源:TopologyWebAppConfiguration.java


示例10: 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


示例11: main

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  Swarm swarm = new Swarm();
  WARArchive deployment = ShrinkWrap.create(WARArchive.class);
  deployment.
      addAllDependencies().
      addClass(JaxRsActivator.class).
      addAsServiceProvider(Extension.class, K8SExtension.class).
      addPackages(true,"ch.trivadis.workshop");
  deployment.staticContent();
  swarm.start();
  swarm.deploy(deployment);
}
 
开发者ID:amoAHCP,项目名称:openshift-workshop,代码行数:13,代码来源:MainApp.java


示例12: 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


示例13: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);

    // on real world deployments, these parts would come from a dependency of the target application
    deployment.addClass(MockTracerResolver.class);
    deployment.addPackage(MockTracer.class.getPackage());
    deployment.addAsServiceProvider(TracerResolver.class, MockTracerResolver.class);

    // this is a simple servlet, that we can hit with our tests
    deployment.addClass(SimpleServlet.class);

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:15,代码来源:TraceResolverOnDeploymentTest.java


示例14: getSecond

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static Archive getSecond() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);
    deployment.setContextRoot("/static");
    deployment.staticContent();
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:8,代码来源:StaticContentContextRootDeploymentTest.java


示例15: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);
    deployment.staticContent("foo");
    // Make sure we're testing from contents inside the jar only
    deployment.delete("WEB-INF/undertow-external-mounts.conf");
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:9,代码来源:StaticContentWarSubdirTest.java


示例16: main

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    /*BEGIN:custom main:JAR_WITH_MAIN*/
    swarm = new Swarm();
    WARArchive war = ShrinkWrap.create(WARArchive.class)
            .addPackage(Main.class.getPackage())
            .addAsWebInfResource(new ClassLoaderAsset("web.xml", Main.class.getClassLoader()), WebXmlAsset.NAME);
    swarm.start().deploy(war);
    /*END:custom main:JAR_WITH_MAIN*/
    /*BEGIN:custom main:WAR_WITH_MAIN*/
    swarm2 = new Swarm().start().deploy();
    /*END:custom main:WAR_WITH_MAIN*/
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:13,代码来源:Main.java


示例17: 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


示例18: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class, "services.war");
    deployment.addAsLibraries(Maven.resolver().resolve("saxon:saxon:8.7").withTransitivity().asFile());
    deployment.addClass(ServicesServlet.class);
    deployment.addClass(TransformerServlet.class);
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:9,代码来源:JAXPOverrideTest.java


示例19: createDeployment

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class, "services.war");
    deployment.addClass(ServicesServlet.class);
    deployment.addClass(TransformerServlet.class);
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:8,代码来源:ArquillianTest.java


示例20: archiveFromCurrentApp

import org.wildfly.swarm.undertow.WARArchive; //导入依赖的package包/类
public static WARArchive archiveFromCurrentApp() throws Exception {
    final WARArchive archive = ShrinkWrap.create(WARArchive.class, determineName());
    final DefaultDeploymentFactory factory = new DefaultWarDeploymentFactory();
    factory.setup(archive);
    //archive.addModule("org.wildfly.swarm.undertow", "runtime");

    return archive;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:9,代码来源:DefaultWarDeploymentFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java XMLContext类代码示例发布时间:2022-05-22
下一篇:
Java EndpointSnitchInfo类代码示例发布时间: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