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


Java WARArchive类代码示例

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


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


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