Skip to content

Commit

Permalink
Remove all non-jakarta servlet containers (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
f4lco committed Sep 17, 2020
1 parent 9670c83 commit 7c15c5c
Show file tree
Hide file tree
Showing 85 changed files with 100 additions and 6,691 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ language: groovy
matrix:
include:
- jdk: openjdk11
env: TEST_ALL_CONTAINERS="['jetty9.3','jetty9.4','tomcat85','tomcat9']" TEST_ALL_GRADLE_VERSION="5.6.4"
env: TEST_ALL_CONTAINERS="['tomcat10']" TEST_ALL_GRADLE_VERSION="5.6.4"
- jdk: openjdk8
env: TEST_ALL_CONTAINERS="['jetty9.3','jetty9.4','tomcat85','tomcat9']" TEST_ALL_GRADLE_VERSION="5.6.4"
env: TEST_ALL_CONTAINERS="['tomcat10']" TEST_ALL_GRADLE_VERSION="5.6.4"
- jdk: openjdk11
env: TEST_ALL_CONTAINERS="['jetty9.3','jetty9.4','tomcat85','tomcat9']" TEST_ALL_GRADLE_VERSION="6.6.1"
env: TEST_ALL_CONTAINERS="['tomcat10']" TEST_ALL_GRADLE_VERSION="6.6.1"
- jdk: openjdk8
env: TEST_ALL_CONTAINERS="['jetty9.3','jetty9.4','tomcat85','tomcat9']" TEST_ALL_GRADLE_VERSION="6.6.1"
env: TEST_ALL_CONTAINERS="['tomcat10']" TEST_ALL_GRADLE_VERSION="6.6.1"
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![License](https://img.shields.io/badge/license-MIT-47b31f.svg)](#copyright-and-license)

Gretty is a feature-rich gradle plugin for running web-apps on embedded servlet containers.
It supports Jetty versions 7, 8 and 9, Tomcat versions 8.5 and 9, multiple web-apps and many more.
It supports Jetty version 10, Tomcat version 10, multiple web-apps and many more.
It wraps servlet container functions as convenient Gradle tasks and configuration DSL.

A complete list of Gretty features is available in [feature overview](https://gretty-gradle-plugin.github.io/gretty-doc/Feature-overview.html).
Expand Down
18 changes: 5 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ developerId = gretty-gradle-plugin
developerName = Andrey Hihlovskiy
license = MIT
group = org.gretty
version = 3.0.4-SNAPSHOT
jetty7_version = 7.6.21.v20160908
jetty7_servlet_api_version = 2.5
jetty8_version = 8.1.22.v20160922
jetty8_servlet_api_version = 3.0.1
jetty9_version = 9.2.26.v20180806
jetty93_version = 9.3.28.v20191105
jetty94_version = 9.4.24.v20191120
jetty9_servlet_api_version = 3.1.0
tomcat85_version = 8.5.49
tomcat85_servlet_api_version = 3.1.0
tomcat9_version = 9.0.37
tomcat9_servlet_api_version = 4.0.1
version = 4.0.0-SNAPSHOT
jetty10_version = 10.0.0.alpha2
jetty10_servlet_api_version = 5.0.0-M1
tomcat10_version = 10.0.0-M4
tomcat10_servlet_api_version = 5.0.0-M1
asm_version = 8.0.1
groovy_version = 2.5.13
spock_version = 1.3-groovy-2.5
Expand Down
16 changes: 0 additions & 16 deletions integrationTests/testJettyServerConfig/jetty/jetty7.xml

This file was deleted.

16 changes: 0 additions & 16 deletions integrationTests/testJettyServerConfig/jetty/jetty8.xml

This file was deleted.

16 changes: 4 additions & 12 deletions libs/gretty-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@ dependencies {
tasks.processResources {
def props = [
grettyVersion: project.version,
jetty7Version: project.jetty7_version,
jetty7ServletApiVersion: project.jetty7_servlet_api_version,
jetty8Version: project.jetty8_version,
jetty8ServletApiVersion: project.jetty8_servlet_api_version,
jetty9Version: project.jetty9_version,
jetty93Version: project.jetty93_version,
jetty94Version: project.jetty94_version,
jetty9ServletApiVersion: project.jetty9_servlet_api_version,
tomcat85Version: project.tomcat85_version,
tomcat85ServletApiVersion: project.tomcat85_servlet_api_version,
tomcat9Version: project.tomcat9_version,
tomcat9ServletApiVersion: project.tomcat9_servlet_api_version,
jetty10Version: project.jetty10_version,
jetty10ServletApiVersion: project.jetty10_servlet_api_version,
tomcat10Version: project.tomcat10_version,
tomcat10ServletApiVersion: project.tomcat10_servlet_api_version,
springBootVersion: project.springBootVersion,
springLoadedVersion: project.springLoadedVersion,
springVersion: project.springVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ServerConfig {
static ServerConfig getDefaultServerConfig(String serverName) {
ServerConfig result = new ServerConfig()
result.jvmArgs = []
result.servletContainer = 'jetty9.4'
result.servletContainer = 'tomcat10'
result.managedClassReload = false
result.httpEnabled = true
result.httpsEnabled = false
Expand All @@ -89,7 +89,7 @@ class ServerConfig {
result.logFileName = serverName
result.redeployMode = 'restart'
result.logDir = "${System.getProperty('user.home')}/logs" as String
result.scanner = 'jetty'
result.scanner = 'jdk'
result.portPropertiesFileName = 'gretty_ports.properties'
result.liveReloadEnabled = false
return result
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
grettyVersion=@grettyVersion@
jetty7Version=@jetty7Version@
jetty7ServletApiVersion=@jetty7ServletApiVersion@
jetty8Version=@jetty8Version@
jetty8ServletApiVersion=@jetty8ServletApiVersion@
jetty9Version=@jetty9Version@
jetty93Version=@jetty93Version@
jetty94Version=@jetty94Version@
jetty9ServletApiVersion=@jetty9ServletApiVersion@
tomcat85Version=@tomcat85Version@
tomcat85ServletApiVersion=@tomcat85ServletApiVersion@
tomcat9Version=@tomcat9Version@
tomcat9ServletApiVersion=@tomcat9ServletApiVersion@
jetty10Version=@jetty10Version@
jetty10ServletApiVersion=@jetty10ServletApiVersion@
tomcat10Version=@tomcat10Version@
tomcat10ServletApiVersion=@tomcat10ServletApiVersion@
springBootVersion=@springBootVersion@
springLoadedVersion=@springLoadedVersion@
springVersion=@springVersion@
Expand Down
2 changes: 1 addition & 1 deletion libs/gretty-filter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply from: rootProject.file('common.gradle')

dependencies {
compile 'javax.servlet:servlet-api:2.5'
compile "jakarta.servlet:jakarta.servlet-api:$tomcat10_servlet_api_version"
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1', {
exclude group: 'commons-logging', module: 'commons-logging'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import groovy.servlet.ServletCategory
import groovyx.net.http.URIBuilder
import groovy.transform.CompileStatic
import groovy.transform.TypeCheckingMode
import javax.servlet.*
import jakarta.servlet.*
import java.util.regex.Pattern
import javax.management.ObjectName
import org.codehaus.groovy.control.customizers.ImportCustomizer
Expand Down Expand Up @@ -165,17 +165,10 @@ class RedirectFilter implements Filter {
// jetty-specific
def server = servletContext.contextHandler.server
server.connectors.each { conn ->
if(server.version.startsWith('7.') || server.version.startsWith('8.')) {
if(conn.getClass().getName() == 'org.eclipse.jetty.server.bio.SocketConnector')
httpPort = conn.port instanceof Integer ? conn.port : Integer.parseInt(conn.port.toString(), 8080)
else if(conn.getClass().getName() == 'org.eclipse.jetty.server.ssl.SslSocketConnector')
httpsPort = conn.port instanceof Integer ? conn.port : Integer.parseInt(conn.port.toString(), 8443)
} else {
if(conn.protocols.find { it.startsWith 'http/' } && !conn.protocols.find { it.startsWith 'ssl-http/' })
httpPort = conn.port instanceof Integer ? conn.port : Integer.parseInt(conn.port.toString(), 8080)
else if(conn.protocols.find { it.startsWith 'http/' } && conn.protocols.find { it.startsWith 'ssl-http/' })
httpsPort = conn.port instanceof Integer ? conn.port : Integer.parseInt(conn.port.toString(), 8443)
}
if(conn.protocols.find { it.startsWith 'http/' } && !conn.protocols.find { it.startsWith 'ssl-http/' })
httpPort = conn.port instanceof Integer ? conn.port : Integer.parseInt(conn.port.toString(), 8080)
else if(conn.protocols.find { it.startsWith 'http/' } && conn.protocols.find { it.startsWith 'ssl-http/' })
httpsPort = conn.port instanceof Integer ? conn.port : Integer.parseInt(conn.port.toString(), 8443)
}
}
else {
Expand Down
20 changes: 0 additions & 20 deletions libs/gretty-runner-jetty7/build.gradle

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7c15c5c

Please sign in to comment.