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

Commit 6cea0cc

Browse files
ilxjameshilliard
authored andcommitted
GH-532 Upgrade to payara-micro 5.193.1
1 parent fe3e9d7 commit 6cea0cc

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ dependencies {
9292
implementation "org.eclipse.jetty:jetty-deploy:${project.property('jetty.version')}"
9393

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

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

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

103+
compile "javax.validation:validation-api:2.0.0.Final"
104+
103105
deploy 'org.apache.maven.wagon:wagon-ssh:2.2'
104106

105107
testImplementation gradleTestKit()

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jetty.version=9.4.21.v20190926
2-
payara.version=5.193
2+
payara.version=5.193.1
33
jruby.version=9.2.8.0
44
jsass.version=5.10.0
55
servlet.version=3.1.0

src/main/groovy/com/devsoap/plugin/servers/PayaraApplicationServer.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class PayaraApplicationServer extends ApplicationServer {
121121
@Override
122122
void defineDependecies(DependencyHandler projectDependencies, DependencySet dependencies) {
123123
Dependency payaraWebProfile = projectDependencies.create(
124-
"fish.payara.extras:payara-embedded-web:${Util.pluginProperties.getProperty('payara.version')}")
124+
"fish.payara.extras:payara-micro:${Util.pluginProperties.getProperty('payara.version')}")
125125
dependencies.add(payaraWebProfile)
126126
}
127127

src/main/java/com/devsoap/plugin/PayaraServerRunner.java

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
*/
1616
package com.devsoap.plugin;
1717

18-
import org.glassfish.embeddable.BootstrapProperties;
19-
import org.glassfish.embeddable.Deployer;
20-
import org.glassfish.embeddable.GlassFish;
21-
import org.glassfish.embeddable.GlassFishProperties;
22-
import org.glassfish.embeddable.GlassFishRuntime;
23-
2418
import java.io.File;
2519
import java.util.logging.Level;
2620
import java.util.logging.Logger;
2721

22+
import fish.payara.micro.PayaraMicro;
23+
import fish.payara.micro.PayaraMicroRuntime;
24+
2825
/**
2926
* Runner for payara
3027
*
@@ -49,25 +46,15 @@ public static void main(String[] args) throws Exception {
4946
LOGGER.log(Level.INFO, "Starting Payara web server...");
5047

5148
try {
52-
53-
BootstrapProperties bootstrap = new BootstrapProperties();
54-
55-
GlassFishRuntime runtime = GlassFishRuntime.bootstrap(bootstrap,
56-
PayaraServerRunner.class.getClass().getClassLoader());
57-
58-
GlassFishProperties glassfishProperties = new GlassFishProperties();
59-
glassfishProperties.setPort("http-listener", port);
49+
PayaraMicro micro = PayaraMicro.getInstance();
50+
micro.setHttpPort(port);
6051
LOGGER.log(Level.INFO, "Running on port "+port);
6152

62-
GlassFish glassfish = runtime.newGlassFish(glassfishProperties);
63-
glassfish.start();
64-
65-
Deployer deployer = glassfish.getDeployer();
66-
6753
File work = new File(workdir);
6854
File explodedWar = new File(work, "war");
6955

70-
deployer.deploy(explodedWar, "--contextroot=");
56+
PayaraMicroRuntime runtime = micro.bootstrap();
57+
runtime.deploy(explodedWar);
7158

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

0 commit comments

Comments
 (0)