Skip to content
This repository was archived by the owner on Apr 2, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,20 @@ dependencies {
compile "org.eclipse.jetty:jetty-deploy:${project.property('jetty.version')}"

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

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

// Sass compilation with libSass
compile "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'

testCompile gradleTestKit()
testCompile 'junit:junit:4.13-SNAPSHOT'
testCompile 'junit:junit:4.12'

// ProxyTest needs its own special configuration to avoid conflicts
proxyTest ('org.mock-server:mockserver-netty:3.10.4') {
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.5.v20170502
payara.version=4.1.153
payara.version=5.183
jruby.version=9.1.10.0
jsass.version=5.5.1
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