Search in sources :

Example 6 with PomEquippedResolveStage

use of org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage in project jbpm by kiegroup.

the class EJBTransactions method buildArchive.

public EnterpriseArchive buildArchive() {
    System.out.println("### Building archive '" + ARCHIVE_NAME + ".war'");
    PomEquippedResolveStage resolver = IntegrationMavenResolver.get("jbpm", "jbpm-persistence");
    File[] dependencies = resolver.importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile();
    LOGGER.debug("Archive dependencies:");
    for (File d : dependencies) {
        LOGGER.debug(d.getName());
    }
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME + ".jar").addPackages(true, "org.jbpm.test.container.groups", EJB_TRANSACTIONS_PACKAGE).addClass(EJBTransactions.class).addClass(JbpmContainerTest.class).addClass(WebSphereFixedJtaPlatform.class).addClass(AbstractEJBTransactionsTest.class).addClass(EJBTransactionsTest.class).addClass(TrackingProcessEventListener.class).addClass(TrackingListenerAssert.class).addAsResource(getClass().getResource("ejbtransactions/" + BPMN_DOUBLE_HUMAN_TASKS), ArchivePaths.create(EJB_TRANSACTIONS_PATH + BPMN_DOUBLE_HUMAN_TASKS)).addAsResource(getClass().getResource("/persistence.xml"), ArchivePaths.create("META-INF/persistence.xml")).addAsResource(EmptyAsset.INSTANCE, ArchivePaths.create("META-INF/beans.xml"));
    ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
    ear.addAsModule(jar).setApplicationXML(getClass().getResource("ejbtransactions/ejb-application.xml")).addAsLibraries(dependencies);
    // META-INF resources
    ear.addAsResource(getClass().getResource("/logback.xml"), ArchivePaths.create("logback.xml"));
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebSphereFixedJtaPlatform(org.jbpm.test.container.webspherefix.WebSphereFixedJtaPlatform) TrackingListenerAssert(org.jbpm.test.container.tools.TrackingListenerAssert) PomEquippedResolveStage(org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage) File(java.io.File) AbstractEJBTransactionsTest(org.jbpm.test.container.AbstractEJBTransactionsTest) EJBTransactionsTest(org.jbpm.test.container.test.EJBTransactionsTest) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 7 with PomEquippedResolveStage

use of org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage in project jbpm by kiegroup.

the class HelloWebService method buildArchive.

public WebArchive buildArchive() {
    System.out.println("### Building archive '" + ARCHIVE_NAME + ".war'");
    PomEquippedResolveStage resolver = IntegrationMavenResolver.get();
    File[] dependencies = resolver.importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile();
    LOGGER.debug("Archive dependencies:");
    for (File d : dependencies) {
        LOGGER.debug(d.getName());
    }
    war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war").addPackage(HELLO_WEB_SERVICE_PACKAGE).addClass(WebSphereFixedJtaPlatform.class).setWebXML(HELLO_WEB_SERVICE_PATH + "WEB-INF/web.xml").addAsLibraries(dependencies);
    return war;
}
Also used : WebSphereFixedJtaPlatform(org.jbpm.test.container.webspherefix.WebSphereFixedJtaPlatform) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) PomEquippedResolveStage(org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage) File(java.io.File)

Example 8 with PomEquippedResolveStage

use of org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage in project jbpm by kiegroup.

the class LocalTransactions method buildArchive.

public WebArchive buildArchive() {
    System.out.println("### Building archive '" + ARCHIVE_NAME + ".war'");
    PomEquippedResolveStage resolver = IntegrationMavenResolver.get("jbpm", "jbpm-persistence");
    File[] dependencies = resolver.importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile();
    LOGGER.debug("Archive dependencies:");
    for (File d : dependencies) {
        LOGGER.debug(d.getName());
    }
    war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war").addAsResource(LOCAL_TRANSACTIONS_PATH + BPMN_TRANSACTIONS).addAsResource(LOCAL_TRANSACTIONS_PATH + BPMN_HELLO_WORLD).addAsResource(LOCAL_TRANSACTIONS_PATH + RULES_TRANSACTIONS).addAsLibraries(dependencies);
    war.addClass(LocalTransactions.class).addClass(WebSphereFixedJtaPlatform.class).addClass(ListWorkItemHandler.class).addClass(TrackingAgendaEventListener.class).addClass(TrackingProcessEventListener.class).addClass(KieUtils.class);
    war.addPackages(true, "org.jbpm.test.container.groups");
    // WEB-INF resources
    war.addAsWebResource(getClass().getResource("/logback.xml"), ArchivePaths.create("logback.xml"));
    // CDI beans.xml
    war.addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("classes/META-INF/beans.xml"));
    war.addAsResource(getClass().getResource("/persistence.xml"), ArchivePaths.create("META-INF/persistence.xml"));
    war.addAsWebResource(getClass().getResource("localtransactions/tomcat-context.xml"), ArchivePaths.create("META-INF/context.xml"));
    war.addAsResource(getClass().getResource("localtransactions/jbossts-properties.xml"), ArchivePaths.create("jbossts-properties.xml"));
    return war;
}
Also used : ListWorkItemHandler(org.jbpm.test.container.handlers.ListWorkItemHandler) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) TrackingProcessEventListener(org.jbpm.test.container.listeners.TrackingProcessEventListener) PomEquippedResolveStage(org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage) File(java.io.File)

Example 9 with PomEquippedResolveStage

use of org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage in project jbpm by kiegroup.

the class RegisterRestService method buildArchive.

public Archive<?> buildArchive() {
    System.out.println("### Building archive '" + ARCHIVE_NAME + ".war'");
    PomEquippedResolveStage resolver = IntegrationMavenResolver.get("rest");
    File[] dependencies = resolver.importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile();
    LOGGER.debug("Archive dependencies:");
    for (File d : dependencies) {
        LOGGER.debug(d.getName());
    }
    war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war").addPackage(REGISTER_REST_SERVICE_PACKAGE).addClass(WebSphereFixedJtaPlatform.class).setWebXML(getClass().getResource("registerrestservice/WEB-INF/web.xml")).addAsWebInfResource(getClass().getResource("registerrestservice/WEB-INF/weblogic.xml"), ArchivePaths.create("weblogic.xml")).addAsLibraries(dependencies);
    // If we are on a WebSphere
    if (System.getProperty("container.port").equals("9080")) {
        EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
        ear.addAsModule(war).setApplicationXML(getClass().getResource("registerrestservice/application.xml")).addAsLibraries(resolver.importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile());
        // META-INF resources for WAS
        ear.addAsApplicationResource(getClass().getResource("registerrestservice/ibm-application-bnd.xml"), ArchivePaths.create("ibm-application-bnd.xml"));
        return ear;
    }
    return war;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) PomEquippedResolveStage(org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage) File(java.io.File)

Aggregations

PomEquippedResolveStage (org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage)9 File (java.io.File)8 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)4 WebSphereFixedJtaPlatform (org.jbpm.test.container.webspherefix.WebSphereFixedJtaPlatform)3 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)2 Field (java.lang.reflect.Field)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Properties (java.util.Properties)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 Stream (java.util.stream.Stream)1 PRIVATE (lombok.AccessLevel.PRIVATE)1 NoArgsConstructor (lombok.NoArgsConstructor)1 LifecycleException (org.apache.catalina.LifecycleException)1 Tomcat (org.apache.catalina.startup.Tomcat)1 RemoteRepository (org.eclipse.aether.repository.RemoteRepository)1 ClassLoaderAsset (org.jboss.shrinkwrap.api.asset.ClassLoaderAsset)1