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
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ dist: xenial
language: groovy
jdk:
- openjdk8
- openjdk9
- openjdk10
- openjdk11
- openjdk12
env:
- TEST_CATEGORY=uncategorizedTests
- TEST_CATEGORY=widgetsetCompileTests
Expand Down
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
2 changes: 1 addition & 1 deletion src/main/java/com/devsoap/plugin/JettyServerRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void main(String[] args) throws Exception {

handler.setContextPath("/");
handler.setBaseResource(Resource.newResource(webAppDir));
handler.setParentLoaderPriority(true);
handler.setParentLoaderPriority(false);

handler.setExtraClasspath(String.join(";", classesDirs) + ";" + resourcesDir);

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