Example #1
0
 public static JavaArchive[] getSpinJacksonJsonDataFormatForServer(string server)
 {
     if (server.Equals("tomcat") || server.Equals("websphere9") || server.Equals("weblogic") || server.Equals("glassfish"))
     {
         return(Maven.configureResolver().workOffline().loadPomFromFile("pom.xml").resolve("org.camunda.spin:camunda-spin-dataformat-json-jackson").@using(new RejectDependenciesStrategy(false, "org.camunda.spin:camunda-spin-core", "org.camunda.commons:camunda-commons-logging", "org.camunda.commons:camunda-commons-utils")).@as(typeof(JavaArchive)));
     }
     else if (server.Equals("websphere"))
     {
         return(Maven.configureResolver().workOffline().loadPomFromFile("pom.xml", "was85").resolve("org.camunda.spin:camunda-spin-dataformat-json-jackson").@using(new RejectDependenciesStrategy(false, "org.camunda.spin:camunda-spin-core", "org.camunda.commons:camunda-commons-logging", "org.camunda.commons:camunda-commons-utils")).@as(typeof(JavaArchive)));
     }
     else
     {
         throw new Exception("Unable to determine dependencies for spinJacksonJsonDataFormat: " + server);
     }
 }
Example #2
0
 public static JavaArchive[] getJodaTimeModuleForServer(string server)
 {
     if (server.Equals("tomcat") || server.Equals("websphere9") || server.Equals("weblogic") || server.Equals("glassfish"))
     {
         return(Maven.configureResolver().workOffline().loadPomFromFile("pom.xml").resolve("com.fasterxml.jackson.datatype:jackson-datatype-joda").@using(new RejectDependenciesStrategy(false, "joda-time:joda-time")).@as(typeof(JavaArchive)));
     }
     else if (server.Equals("websphere"))
     {
         return(Maven.configureResolver().workOffline().loadPomFromFile("pom.xml", "was85").resolve("com.fasterxml.jackson.datatype:jackson-datatype-joda").@using(new RejectDependenciesStrategy(false, "joda-time:joda-time")).@as(typeof(JavaArchive)));
     }
     else if (server.Equals("jboss"))
     {
         return(Maven.configureResolver().workOffline().loadPomFromFile("pom.xml").resolve("com.fasterxml.jackson.datatype:jackson-datatype-joda").@using(new RejectDependenciesStrategy(false, "com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-core", "com.fasterxml.jackson.core:jackson-databind")).@as(typeof(JavaArchive)));
     }
     else
     {
         throw new Exception("Unable to determine dependencies for jodaTimeModule: " + server);
     }
 }
Example #3
0
        public override void start()
        {
            Properties serverProperties = readProperties();
            int        port             = int.Parse(serverProperties.getProperty(PORT_PROPERTY));

            tomcat         = new Tomcat();
            tomcat.Port    = port;
            tomcat.BaseDir = WorkingDir;

            tomcat.Host.AppBase         = WorkingDir;
            tomcat.Host.AutoDeploy      = true;
            tomcat.Host.DeployOnStartup = true;

            string contextPath = "/" + ContextPath;

            PomEquippedResolveStage resolver = Maven.configureResolver().useLegacyLocalRepo(true).workOffline().loadPomFromFile("pom.xml");

            WebArchive wa = ShrinkWrap.create(typeof(WebArchive), "rest-test.war").setWebXML(webXmlPath).addAsLibraries(resolver.resolve("org.codehaus.jackson:jackson-jaxrs:1.6.5").withTransitivity().asFile()).addAsLibraries(resolver.addDependencies(MavenDependencies.createDependency("org.mockito:mockito-core", ScopeType.TEST, false, MavenDependencies.createExclusion("org.hamcrest:hamcrest-core"))).resolve().withTransitivity().asFile()).addAsServiceProvider(typeof(ProcessEngineProvider), typeof(MockedProcessEngineProvider)).add(new ClassLoaderAsset("runtime/tomcat/context.xml"), "META-INF/context.xml").addPackages(true, "org.camunda.bpm.engine.rest");

            addRuntimeSpecificLibraries(wa, resolver);
            wa.WebXML = webXmlPath;

            string webAppPath = WorkingDir + "/" + ContextPath + ".war";

            wa.@as(typeof(ZipExporter)).exportTo(new File(webAppPath), true);

            tomcat.addWebapp(tomcat.Host, contextPath, webAppPath);

            try
            {
                tomcat.start();
            }
            catch (LifecycleException e)
            {
                throw new Exception(e);
            }
        }