Upgrade to Jetty 12

Closes gh-36073
This commit is contained in:
Andy Wilkinson
2023-01-16 11:11:45 +00:00
parent 02fd570b7d
commit ed5d16de84
57 changed files with 377 additions and 695 deletions

View File

@@ -41,14 +41,6 @@ configurations {
}
}
dependencyManagement {
jetty {
dependencies {
dependency "jakarta.servlet:jakarta.servlet-api:5.0.0"
}
}
}
tasks.register("resourcesJar", Jar) { jar ->
def nested = project.resources.text.fromString("nested")
from(nested) {
@@ -66,7 +58,7 @@ tasks.register("resourcesJar", Jar) { jar ->
}
dependencies {
compileOnly("org.eclipse.jetty:jetty-server")
compileOnly("org.eclipse.jetty.ee10:jetty-ee10-servlet")
compileOnly("org.springframework:spring-web")
implementation("org.springframework.boot:spring-boot-starter")

View File

@@ -11,10 +11,6 @@ configurations {
}
}
configurations.all {
resolutionStrategy.force("jakarta.servlet:jakarta.servlet-api:5.0.0")
}
dependencies {
compileOnly(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jetty"))
@@ -22,10 +18,7 @@ dependencies {
exclude module: "spring-boot-starter-tomcat"
}
providedRuntime("org.eclipse.jetty:apache-jsp") {
exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api"
exclude group: "org.eclipse.jetty.toolchain", module: "jetty-schemas"
}
providedRuntime("org.eclipse.jetty.ee10:jetty-ee10-apache-jsp")
runtimeOnly("org.glassfish.web:jakarta.servlet.jsp.jstl")

View File

@@ -1,3 +1,4 @@
application.message: Hello Spring Boot
server.servlet.jsp.class-name=org.eclipse.jetty.ee10.jsp.JettyJspServlet
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
application.message: Hello Spring Boot

View File

@@ -5,10 +5,6 @@ plugins {
description = "Spring Boot Jetty SSL smoke test"
configurations.all {
resolutionStrategy.force("jakarta.servlet:jakarta.servlet-api:5.0.0")
}
dependencies {
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jetty"))
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) {

View File

@@ -5,10 +5,6 @@ plugins {
description = "Spring Boot Jetty smoke test"
configurations.all {
resolutionStrategy.force("jakarta.servlet:jakarta.servlet-api:5.0.0")
}
dependencies {
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) {
exclude module: "spring-boot-starter-tomcat"

View File

@@ -2,4 +2,4 @@ server.compression.enabled: true
server.compression.min-response-size: 1
server.max-http-request-header-size=1000
server.jetty.threads.acceptors=2
server.jetty.max-http-response-header-size=1000
server.jetty.max-http-response-header-size=4096

View File

@@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Florian Storz
* @author Michael Weidmann
*/
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "logging.level.org.eclipse:trace")
@ExtendWith(OutputCaptureExtension.class)
class SampleJettyApplicationTests {
@@ -65,9 +65,8 @@ class SampleJettyApplicationTests {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("Hello World");
// Jetty HttpClient decodes gzip reponses automatically
// Check that we received a gzip-encoded response
assertThat(entity.getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING)).isEqualTo("gzip");
// Jetty HttpClient decodes gzip reponses automatically and removes the
// Content-Encoding header. We have to assume that the response was gzipped.
}
@Test

View File

@@ -5,10 +5,6 @@ plugins {
description = "Spring Boot WebSocket Jetty smoke test"
configurations.all {
resolutionStrategy.force("jakarta.servlet:jakarta.servlet-api:5.0.0")
}
dependencies {
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jetty"))
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-websocket")) {