Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
GH-532 Upgrade to payara-micro 5.193.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ilx authored and jameshilliard committed Oct 9, 2019
1 parent fe3e9d7 commit 6cea0cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,16 @@ dependencies {
implementation "org.eclipse.jetty:jetty-deploy:${project.property('jetty.version')}"

//Payara application server
implementation "fish.payara.extras:payara-embedded-web:${project.property('payara.version')}"
implementation "fish.payara.extras:payara-micro:${project.property('payara.version')}"

// For GET requests
implementation 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'

// Sass compilation with libSass
implementation "io.bit3:jsass:${project.property('jsass.version')}"

compile "javax.validation:validation-api:2.0.0.Final"

deploy 'org.apache.maven.wagon:wagon-ssh:2.2'

testImplementation gradleTestKit()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jetty.version=9.4.21.v20190926
payara.version=5.193
payara.version=5.193.1
jruby.version=9.2.8.0
jsass.version=5.10.0
servlet.version=3.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class PayaraApplicationServer extends ApplicationServer {
@Override
void defineDependecies(DependencyHandler projectDependencies, DependencySet dependencies) {
Dependency payaraWebProfile = projectDependencies.create(
"fish.payara.extras:payara-embedded-web:${Util.pluginProperties.getProperty('payara.version')}")
"fish.payara.extras:payara-micro:${Util.pluginProperties.getProperty('payara.version')}")
dependencies.add(payaraWebProfile)
}

Expand Down
27 changes: 7 additions & 20 deletions src/main/java/com/devsoap/plugin/PayaraServerRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@
*/
package com.devsoap.plugin;

import org.glassfish.embeddable.BootstrapProperties;
import org.glassfish.embeddable.Deployer;
import org.glassfish.embeddable.GlassFish;
import org.glassfish.embeddable.GlassFishProperties;
import org.glassfish.embeddable.GlassFishRuntime;

import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;

import fish.payara.micro.PayaraMicro;
import fish.payara.micro.PayaraMicroRuntime;

/**
* Runner for payara
*
Expand All @@ -49,25 +46,15 @@ public static void main(String[] args) throws Exception {
LOGGER.log(Level.INFO, "Starting Payara web server...");

try {

BootstrapProperties bootstrap = new BootstrapProperties();

GlassFishRuntime runtime = GlassFishRuntime.bootstrap(bootstrap,
PayaraServerRunner.class.getClass().getClassLoader());

GlassFishProperties glassfishProperties = new GlassFishProperties();
glassfishProperties.setPort("http-listener", port);
PayaraMicro micro = PayaraMicro.getInstance();
micro.setHttpPort(port);
LOGGER.log(Level.INFO, "Running on port "+port);

GlassFish glassfish = runtime.newGlassFish(glassfishProperties);
glassfish.start();

Deployer deployer = glassfish.getDeployer();

File work = new File(workdir);
File explodedWar = new File(work, "war");

deployer.deploy(explodedWar, "--contextroot=");
PayaraMicroRuntime runtime = micro.bootstrap();
runtime.deploy(explodedWar);

} catch (Exception ex){
LOGGER.log(Level.SEVERE, "Failed to start Payara server", ex);
Expand Down

0 comments on commit 6cea0cc

Please sign in to comment.