Skip to content

Commit 8bfb170

Browse files
committed
Remove support for Jersey
Spring Boot 4 requires Jakarta EE 11. Jersey 4 will support EE 11 but its release schedule is uncertain. Furthermore, Jersey does not yet support Jackson 3 and there's no clear timeline for when Jackson 3 will be supported. In light of the above, this commit removes support for Jersey. Reinstating support can be considered once there's a Jersey GA that supports Jakarta EE 11 or its clear that one will be available in time for Boot's GA in November. Ideally, support for Jackson 3 would also be available before reinstating Jersey support. Closes gh-47017
1 parent b52c55d commit 8bfb170

File tree

118 files changed

+32
-6967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+32
-6967
lines changed

configuration-metadata/spring-boot-configuration-metadata-changelog-generator/build.gradle

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def dependenciesOf(String version) {
8686
"spring-boot-integration",
8787
"spring-boot-jackson",
8888
"spring-boot-jdbc",
89-
"spring-boot-jersey",
9089
"spring-boot-jetty",
9190
"spring-boot-jms",
9291
"spring-boot-jooq",
@@ -133,19 +132,24 @@ def dependenciesOf(String version) {
133132
"spring-boot-webservices",
134133
"spring-boot-zipkin"
135134
]
136-
if (version.equals("4.0.0-M1")) {
135+
if (version.equals("4.0.0-M1") || version.equals("4.0.0-M2")) {
137136
modules += [
138-
"spring-boot-metrics",
139-
"spring-boot-observation",
140-
"spring-boot-tracing"
141-
]
142-
}
143-
else {
144-
modules += [
145-
"spring-boot-micrometer-metrics",
146-
"spring-boot-micrometer-observation",
147-
"spring-boot-micrometer-tracing"
137+
"spring-boot-jersey"
148138
]
139+
if (version.equals("4.0.0-M1")) {
140+
modules += [
141+
"spring-boot-metrics",
142+
"spring-boot-observation",
143+
"spring-boot-tracing"
144+
]
145+
}
146+
else {
147+
modules += [
148+
"spring-boot-micrometer-metrics",
149+
"spring-boot-micrometer-observation",
150+
"spring-boot-micrometer-tracing"
151+
]
152+
}
149153
}
150154
return modules
151155
}

documentation/spring-boot-docs/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ dependencies {
138138
implementation("org.assertj:assertj-core")
139139
implementation("org.cache2k:cache2k-spring")
140140
implementation("org.apache.groovy:groovy")
141-
implementation("org.glassfish.jersey.containers:jersey-container-servlet-core")
142-
implementation("org.glassfish.jersey.core:jersey-server")
143141
implementation("org.hibernate.orm:hibernate-jcache") {
144142
exclude group: "javax.activation", module: "javax.activation-api"
145143
exclude group: "javax.persistence", module: "javax.persistence-api"

documentation/spring-boot-docs/src/docs/antora/modules/ROOT/pages/documentation.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ xref:reference:features/index.adoc[The following content is for you]:
6363

6464
If you develop Spring Boot web applications, take a look at the following content:
6565

66-
* *Servlet Web Applications:* xref:reference:web/servlet.adoc[Spring MVC, Jersey, Embedded Servlet Containers]
66+
* *Servlet Web Applications:* xref:reference:web/servlet.adoc[Spring MVC, Embedded Servlet Containers]
6767
* *Reactive Web Applications:* xref:reference:web/reactive.adoc[Spring Webflux, Embedded Servlet Containers]
6868
* *Graceful Shutdown:* xref:reference:web/graceful-shutdown.adoc[Graceful Shutdown]
6969
* *Spring Security:* xref:reference:web/spring-security.adoc[Default Security Configuration, Auto-configuration for OAuth2, SAML]

documentation/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,6 @@
566566
* xref:how-to:index.adoc#howto[#howto]
567567
* xref:how-to:index.adoc[#howto]
568568
* xref:how-to:index.adoc[howto]
569-
* xref:how-to:jersey.adoc#howto.jersey.alongside-another-web-framework[#howto-jersey-alongside-another-web-framework]
570-
* xref:how-to:jersey.adoc#howto.jersey.alongside-another-web-framework[#howto.jersey.alongside-another-web-framework]
571-
* xref:how-to:jersey.adoc#howto.jersey.spring-security[#howto-jersey-spring-security]
572-
* xref:how-to:jersey.adoc#howto.jersey.spring-security[#howto.jersey.spring-security]
573-
* xref:how-to:jersey.adoc#howto.jersey[#howto-jersey]
574-
* xref:how-to:jersey.adoc#howto.jersey[#howto.jersey]
575569
* xref:how-to:logging.adoc#howto.logging.log4j.composite-configuration[#howto.logging.log4j.composite-configuration]
576570
* xref:how-to:logging.adoc#howto.logging.log4j.yaml-or-json-config[#howto-configure-log4j-for-logging-yaml-or-json-config]
577571
* xref:how-to:logging.adoc#howto.logging.log4j.yaml-or-json-config[#howto.logging.log4j.yaml-or-json-config]
@@ -1152,8 +1146,6 @@
11521146
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.http-clients[#production-ready-metrics-http-clients]
11531147
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jdbc[#actuator.metrics.supported.jdbc]
11541148
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jdbc[#production-ready-metrics-jdbc]
1155-
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jersey[#actuator.metrics.supported.jersey]
1156-
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jersey[#production-ready-metrics-jersey-server]
11571149
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jetty[#actuator.metrics.supported.jetty]
11581150
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jms[#actuator.metrics.supported.jms]
11591151
* xref:reference:actuator/metrics.adoc#actuator.metrics.supported.jvm[#actuator.metrics.supported.jvm]
@@ -2130,9 +2122,6 @@
21302122
* xref:reference:web/servlet.adoc#web.servlet.embedded-container[#boot-features-embedded-container]
21312123
* xref:reference:web/servlet.adoc#web.servlet.embedded-container[#features.developing-web-applications.embedded-container]
21322124
* xref:reference:web/servlet.adoc#web.servlet.embedded-container[#web.servlet.embedded-container]
2133-
* xref:reference:web/servlet.adoc#web.servlet.jersey[#boot-features-jersey]
2134-
* xref:reference:web/servlet.adoc#web.servlet.jersey[#features.developing-web-applications.jersey]
2135-
* xref:reference:web/servlet.adoc#web.servlet.jersey[#web.servlet.jersey]
21362125
* xref:reference:web/servlet.adoc#web.servlet.spring-mvc.auto-configuration[#boot-features-spring-mvc-auto-configuration]
21372126
* xref:reference:web/servlet.adoc#web.servlet.spring-mvc.auto-configuration[#features.developing-web-applications.spring-mvc.auto-configuration]
21382127
* xref:reference:web/servlet.adoc#web.servlet.spring-mvc.auto-configuration[#web.servlet.spring-mvc.auto-configuration]

documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/jersey.adoc

Lines changed: 0 additions & 26 deletions
This file was deleted.

documentation/spring-boot-docs/src/docs/antora/modules/how-to/partials/nav-how-to.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
** xref:how-to:properties-and-configuration.adoc[]
55
** xref:how-to:webserver.adoc[]
66
** xref:how-to:spring-mvc.adoc[]
7-
** xref:how-to:jersey.adoc[]
87
** xref:how-to:http-clients.adoc[]
98
** xref:how-to:logging.adoc[]
109
** xref:how-to:data-access.adoc[]

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Subject to xref:actuator/endpoints.adoc#actuator.endpoints.sanitization[sanitiza
9595
| Performs a thread dump.
9696
|===
9797

98-
If your application is a web application (Spring MVC, Spring WebFlux, or Jersey), you can use the following additional endpoints:
98+
If your application is a web application (Spring MVC or Spring WebFlux), you can use the following additional endpoints:
9999

100100
[cols="2,5"]
101101
|===
@@ -388,8 +388,7 @@ TIP: See javadoc:org.springframework.boot.actuate.autoconfigure.endpoint.web.Cor
388388
== Implementing Custom Endpoints
389389

390390
If you add a javadoc:org.springframework.context.annotation.Bean[format=annotation] annotated with javadoc:org.springframework.boot.actuate.endpoint.annotation.Endpoint[format=annotation], any methods annotated with javadoc:org.springframework.boot.actuate.endpoint.annotation.ReadOperation[format=annotation], javadoc:org.springframework.boot.actuate.endpoint.annotation.WriteOperation[format=annotation], or javadoc:org.springframework.boot.actuate.endpoint.annotation.DeleteOperation[format=annotation] are automatically exposed over JMX and, in a web application, over HTTP as well.
391-
Endpoints can be exposed over HTTP by using Jersey, Spring MVC, or Spring WebFlux.
392-
If both Jersey and Spring MVC are available, Spring MVC is used.
391+
Endpoints can be exposed over HTTP by using Spring MVC or Spring WebFlux.
393392

394393
The following example exposes a read operation that returns a custom object:
395394

@@ -451,8 +450,7 @@ Before calling an operation method, the input received over JMX or HTTP is conve
451450
[[actuator.endpoints.implementing-custom.web]]
452451
=== Custom Web Endpoints
453452

454-
Operations on an javadoc:org.springframework.boot.actuate.endpoint.annotation.Endpoint[format=annotation], javadoc:org.springframework.boot.actuate.endpoint.web.annotation.WebEndpoint[format=annotation], or javadoc:org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension[format=annotation] are automatically exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
455-
If both Jersey and Spring MVC are available, Spring MVC is used.
453+
Operations on an javadoc:org.springframework.boot.actuate.endpoint.annotation.Endpoint[format=annotation], javadoc:org.springframework.boot.actuate.endpoint.web.annotation.WebEndpoint[format=annotation], or javadoc:org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension[format=annotation] are automatically exposed over HTTP using Spring MVC or Spring WebFlux.
456454

457455

458456

@@ -540,8 +538,6 @@ If an operation is invoked without a required parameter or with a parameter that
540538
You can use an HTTP range request to request part of an HTTP resource.
541539
When using Spring MVC or Spring Web Flux, operations that return a javadoc:org.springframework.core.io.Resource[] automatically support range requests.
542540

543-
NOTE: Range requests are not supported when using Jersey.
544-
545541

546542

547543
[[actuator.endpoints.implementing-custom.web.security]]

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/metrics.adoc

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -765,39 +765,6 @@ Applications can opt in and record exceptions by xref:web/reactive.adoc#web.reac
765765

766766

767767

768-
[[actuator.metrics.supported.jersey]]
769-
=== Jersey Server Metrics
770-
771-
Auto-configuration enables the instrumentation of all requests handled by the Jersey JAX-RS implementation.
772-
By default, metrics are generated with the name, `http.server.requests`.
773-
You can customize the name by setting the configprop:management.observations.http.server.requests.name[] property.
774-
775-
By default, Jersey server metrics are tagged with the following information:
776-
777-
|===
778-
| Tag | Description
779-
780-
| `exception`
781-
| The simple class name of any exception that was thrown while handling the request.
782-
783-
| `method`
784-
| The request's method (for example, `GET` or `POST`)
785-
786-
| `outcome`
787-
| The request's outcome, based on the status code of the response.
788-
1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx is `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
789-
790-
| `status`
791-
| The response's HTTP status code (for example, `200` or `500`)
792-
793-
| `uri`
794-
| The request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
795-
|===
796-
797-
To customize the tags, provide a javadoc:org.springframework.context.annotation.Bean[format=annotation] that implements javadoc:io.micrometer.core.instrument.binder.jersey.server.JerseyObservationConvention[].
798-
799-
800-
801768
[[actuator.metrics.supported.ssl]]
802769
=== SSL Bundle Metrics
803770

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/monitoring.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ If you are developing a web application, Spring Boot Actuator auto-configures al
55
The default convention is to use the `id` of the endpoint with a prefix of `/actuator` as the URL path.
66
For example, `health` is exposed as `/actuator/health`.
77

8-
TIP: Actuator is supported natively with Spring MVC, Spring WebFlux, and Jersey.
9-
If both Jersey and Spring MVC are available, Spring MVC is used.
8+
TIP: Actuator is supported natively with Spring MVC and Spring WebFlux.
109

1110
NOTE: Jackson is a required dependency in order to get the correct JSON responses as documented in the xref:api:rest/actuator/index.adoc[API documentation].
1211

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/web/servlet.adoc

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[web.servlet]]
22
= Servlet Web Applications
33

4-
If you want to build servlet-based web applications, you can take advantage of Spring Boot's auto-configuration for Spring MVC or Jersey.
4+
If you want to build servlet-based web applications, you can take advantage of Spring Boot's auto-configuration for Spring MVC.
55

66

77

@@ -497,43 +497,6 @@ See xref:io/rest-client.adoc#io.rest-client.apiversioning[] for details.
497497

498498

499499

500-
[[web.servlet.jersey]]
501-
== JAX-RS and Jersey
502-
503-
If you prefer the JAX-RS programming model for REST endpoints, you can use one of the available implementations instead of Spring MVC.
504-
https://jersey.github.io/[Jersey] and https://cxf.apache.org/[Apache CXF] work quite well out of the box.
505-
CXF requires you to register its javadoc:jakarta.servlet.Servlet[] or javadoc:jakarta.servlet.Filter[] as a javadoc:org.springframework.context.annotation.Bean[format=annotation] in your application context.
506-
Jersey has some native Spring support, so we also provide auto-configuration support for it in Spring Boot, together with a starter.
507-
508-
To get started with Jersey, include the `spring-boot-starter-jersey` as a dependency and then you need one javadoc:org.springframework.context.annotation.Bean[format=annotation] of type javadoc:org.glassfish.jersey.server.ResourceConfig[] in which you register all the endpoints, as shown in the following example:
509-
510-
include-code::MyJerseyConfig[]
511-
512-
WARNING: Jersey's support for scanning executable archives is rather limited.
513-
For example, it cannot scan for endpoints in a package found in a xref:how-to:deployment/installing.adoc[fully executable jar file] or in `WEB-INF/classes` when running an executable war file.
514-
To avoid this limitation, the `packages` method should not be used, and endpoints should be registered individually by using the `register` method, as shown in the preceding example.
515-
516-
For more advanced customizations, you can also register an arbitrary number of beans that implement javadoc:org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer[].
517-
518-
All the registered endpoints should be a javadoc:org.springframework.stereotype.Component[format=annotation] with HTTP resource annotations (`@GET` and others), as shown in the following example:
519-
520-
include-code::MyEndpoint[]
521-
522-
Since the javadoc:org.springframework.boot.actuate.endpoint.annotation.Endpoint[format=annotation] is a Spring javadoc:org.springframework.stereotype.Component[format=annotation], its lifecycle is managed by Spring and you can use the javadoc:org.springframework.beans.factory.annotation.Autowired[format=annotation] annotation to inject dependencies and use the javadoc:org.springframework.beans.factory.annotation.Value[format=annotation] annotation to inject external configuration.
523-
By default, the Jersey servlet is registered and mapped to `/*`.
524-
You can change the mapping by adding javadoc:jakarta.ws.rs.ApplicationPath[format=annotation] to your javadoc:org.glassfish.jersey.server.ResourceConfig[].
525-
526-
By default, Jersey is set up as a servlet in a javadoc:org.springframework.context.annotation.Bean[format=annotation] of type javadoc:org.springframework.boot.web.servlet.ServletRegistrationBean[] named `jerseyServletRegistration`.
527-
By default, the servlet is initialized lazily, but you can customize that behavior by setting `spring.jersey.servlet.load-on-startup`.
528-
You can disable or override that bean by creating one of your own with the same name.
529-
You can also use a filter instead of a servlet by setting `spring.jersey.type=filter` (in which case, the javadoc:org.springframework.context.annotation.Bean[format=annotation] to replace or override is `jerseyFilterRegistration`).
530-
The filter has an javadoc:org.springframework.core.annotation.Order[format=annotation], which you can set with `spring.jersey.filter.order`.
531-
When using Jersey as a filter, a servlet that will handle any requests that are not intercepted by Jersey must be present.
532-
If your application does not contain such a servlet, you may want to enable the default servlet by setting configprop:server.servlet.register-default-servlet[] to `true`.
533-
Both the servlet and the filter registrations can be given init parameters by using `spring.jersey.init.*` to specify a map of properties.
534-
535-
536-
537500
[[web.servlet.embedded-container]]
538501
== Embedded Servlet Container Support
539502

0 commit comments

Comments
 (0)