Skip to content

Commit 0acf95f

Browse files
committed
[#1802] Switch pax-web-jsp from javax to jakarta
1 parent fcd1dc1 commit 0acf95f

20 files changed

+397
-406
lines changed

pax-web-api/pom.xml

+2-7
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
org.osgi.framework;version="[1.10,2)",
137137
org.osgi.framework.wiring;version="[1.2,2)",
138138

139-
<!-- OSGi CMPN R8.1 140 Jakarta Servlet packages (formerly known as Whiteboard) -->
139+
<!-- OSGi CMPN R8.1 140 Whiteboard Specification for Jakarta™ Servlet -->
140140
org.osgi.service.servlet.context;version="2.0.0",
141141
org.osgi.service.servlet.runtime;version="2.0.0",
142142
org.osgi.service.servlet.runtime.dto;version="2.0.0",
@@ -218,11 +218,6 @@
218218
<artifactId>org.osgi.namespace.extender</artifactId>
219219
<scope>provided</scope>
220220
</dependency>
221-
<dependency>
222-
<groupId>org.osgi</groupId>
223-
<artifactId>org.osgi.service.http</artifactId>
224-
<scope>provided</scope>
225-
</dependency>
226221
<dependency>
227222
<groupId>org.osgi</groupId>
228223
<artifactId>org.osgi.service.servlet</artifactId>
@@ -287,7 +282,7 @@
287282
<dependency>
288283
<groupId>org.assertj</groupId>
289284
<artifactId>assertj-core</artifactId>
290-
<version>${dependency.org.assertj}</version>
285+
<scope>test</scope>
291286
</dependency>
292287
<dependency>
293288
<groupId>org.springframework</groupId>

pax-web-api/src/main/java/org/ops4j/pax/web/service/PaxWebConstants.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public interface PaxWebConstants {
7171
* The only supported {@link jakarta.servlet.ServletContainerInitializer} class that configures WebSocket
7272
* container for Jetty
7373
*/
74-
String DEFAULT_WEBSOCKET_JETTY_SCI_CLASS = "org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer";
74+
String DEFAULT_WEBSOCKET_JETTY_SCI_CLASS = "org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer";
7575
/**
7676
* The only supported {@link jakarta.servlet.ServletContainerInitializer} class that configures WebSocket
7777
* container for Tomcat
@@ -280,6 +280,7 @@ public interface PaxWebConstants {
280280
* help us provide nice OSGi-aware discovery mechanism. That's why this context parameter will provide special
281281
* {@link java.util.Map} that can be used when searching for FACELET resources.</p>
282282
*/
283+
// TODO: JakartaEE 10
283284
String CONTEXT_PARAM_PAX_WEB_FACELETS_LIBRARIES = "org.ops4j.pax.web.javax.faces.FACELETS_LIBRARIES";
284285

285286
// --- 3 properties defined in 128.3.4 "Publishing the Servlet Context" (and one Pax Web specific)
@@ -296,4 +297,9 @@ public interface PaxWebConstants {
296297
/** Context name of the WAB bundle or bundle registering OSGi servlet context (Pax Web addition) */
297298
String SERVICE_PROPERTY_WEB_SERVLETCONTEXT_NAME = "osgi.web.contextname";
298299

300+
/**
301+
* For compatibility purpose (OSGi CMPN 8: {@code org.osgi.service.http.whiteboard.HttpWhiteboardConstants#HTTP_SERVICE_CONTEXT_PROPERTY})
302+
*/
303+
String HTTP_SERVICE_CONTEXT_PROPERTY = "osgi.http.whiteboard.context.httpservice";
304+
299305
}

pax-web-api/src/main/java/org/ops4j/pax/web/service/WebContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ void setSessionCookieConfig(String domain, String name, Boolean httpOnly, Boolea
880880
// methods used to register annotated web socket endpoints
881881

882882
/**
883-
* Registers a WebSocket endpoint annotated with {@code @javax.websocket.server.ServerEndpoint}. The actual
883+
* Registers a WebSocket endpoint annotated with {@code @jakarta.websocket.server.ServerEndpoint}. The actual
884884
* object passed may be both an actual instance or a {@link Class} object which will be instantiated when needed.
885885
* @param webSocket
886886
* @param httpContext
@@ -891,7 +891,7 @@ void setSessionCookieConfig(String domain, String name, Boolean httpOnly, Boolea
891891

892892
/**
893893
* Unregisters a previously registered WebSocket endpoint annotated with
894-
* {@code @javax.websocket.server.ServerEndpoint}
894+
* {@code @jakarta.websocket.server.ServerEndpoint}
895895
* @param webSocket
896896
* @param httpContext
897897
*/

pax-web-api/src/main/java/org/ops4j/pax/web/service/http/package-info.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
* namespace.</p>
2222
*
2323
* <p>Original package is {@code org.osgi.service.http}. There's no new equivalen of this package and users
24-
* are encouraged to move to <a href="https://docs.osgi.org/specification/osgi.cmpn/8.1.0/service.servlet.html">Jakarta Servlet Specificaiton</a> (formerly known as
25-
* <em>Whiteboard specification</em>).</p>
24+
* are encouraged to move to <a href="https://docs.osgi.org/specification/osgi.cmpn/8.1.0/service.servlet.html">Whiteboard Specification for Jakarta™ Servlet</a>.</p>
2625
*/
2726
package org.ops4j.pax.web.service.http;

pax-web-api/src/main/java/org/ops4j/pax/web/service/whiteboard/WebSocketMapping.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@
2323
* <p>On purpose, we don't allow registration of other objects that usually can be passed (by means of
2424
* {@link jakarta.servlet.annotation.HandlesTypes} annotation on a {@link jakarta.servlet.ServletContainerInitializer}
2525
* related to WebSockets) by users. Only annontated classes or actual instances are handled and we don't support:<ul>
26-
* <li>{@code javax.websocket.server.ServerApplicationConfig}</li>
27-
* <li>{@code javax.websocket.Endpoint}</li>
26+
* <li>{@code jakarta.websocket.server.ServerApplicationConfig}</li>
27+
* <li>{@code jakarta.websocket.Endpoint}</li>
2828
* </ul></p>
2929
*/
3030
public interface WebSocketMapping extends ContextRelated {
3131

3232
/**
3333
* Returns a {@link Class} of the WebSocket endpoint that should be annotated with
34-
* {@code @javax.websocket.server.ServerEndpoint} annotation. If both the
34+
* {@code @jakarta.websocket.server.ServerEndpoint} annotation. If both the
3535
* object ({@link #getWebSocketAnnotatedEndpoint()}) and the class is specified, the class takes precedence.
3636
* @return
3737
*/
3838
Class<?> getWebSocketClass();
3939

4040
/**
41-
* Returns an instance of a class annotated with {@code @javax.websocket.server.ServerEndpoint}. If both the
41+
* Returns an instance of a class annotated with {@code @jakarta.websocket.server.ServerEndpoint}. If both the
4242
* object and the class ({@link #getWebSocketClass()}) is specified, the class takes precedence.
4343
* @return
4444
*/

pax-web-jsp/pom.xml

+64-83
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,41 @@
4444
<configuration>
4545
<instructions>
4646
<Import-Package>
47-
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
48-
javax.servlet;version="[3.1,5)",
49-
javax.servlet.annotation;version="[3.1,5)",
50-
javax.servlet.descriptor;version="[3.1,5)",
51-
javax.servlet.http;version="[3.1,5)",
47+
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
48+
jakarta.servlet;version="[6,7)",
49+
jakarta.servlet.annotation;version="[6,7)",
50+
jakarta.servlet.descriptor;version="[6,7)",
51+
jakarta.servlet.http;version="[6,7)",
5252

5353
<!-- JSP API (also exported from pax-web-jsp - this bundle) -->
54-
javax.servlet.jsp;version="2.3",
55-
javax.servlet.jsp.el;version="2.3",
56-
javax.servlet.jsp.tagext;version="2.3",
54+
jakarta.servlet.jsp;version="${dependency.jakarta.servlet.jsp-api}",
55+
jakarta.servlet.jsp.el;version="${dependency.jakarta.servlet.jsp-api}",
56+
jakarta.servlet.jsp.tagext;version="${dependency.jakarta.servlet.jsp-api}",
5757

5858
<!-- JSTL API (also exported from pax-web-jsp - this bundle) -->
59-
javax.servlet.jsp.jstl.core;version="${dependency.jakarta.servlet.jsp.jstl-api}",
60-
javax.servlet.jsp.jstl.fmt;version="${dependency.jakarta.servlet.jsp.jstl-api}",
61-
javax.servlet.jsp.jstl.sql;version="${dependency.jakarta.servlet.jsp.jstl-api}",
62-
javax.servlet.jsp.jstl.tlv;version="${dependency.jakarta.servlet.jsp.jstl-api}",
59+
jakarta.servlet.jsp.jstl.core;version="${dependency.jakarta.servlet.jsp.jstl-api}",
60+
jakarta.servlet.jsp.jstl.fmt;version="${dependency.jakarta.servlet.jsp.jstl-api}",
61+
jakarta.servlet.jsp.jstl.sql;version="${dependency.jakarta.servlet.jsp.jstl-api}",
62+
jakarta.servlet.jsp.jstl.tlv;version="${dependency.jakarta.servlet.jsp.jstl-api}",
6363

6464
<!-- EL API (only imported - from jakarta.el:jakarta.el-api) -->
65-
javax.el;version="[3.0,4)",
65+
jakarta.el;version="[5.0,6)",
6666

67-
<!-- ranges indicate we can work with OSGi Core R6+ -->
68-
org.osgi.framework;version="[1.8,2)",
67+
<!-- OSGi Core R8+ -->
68+
org.osgi.dto;version="[1.1,2)",
69+
org.osgi.framework;version="[1.10,2)",
6970
org.osgi.framework.wiring;version="[1.2,2)",
7071
org.osgi.util.tracker;version="[1.5,2)",
7172

72-
<!-- OSGi cmpn -->
73-
org.osgi.service.http;version="[1.2,2)",
74-
7573
<!-- from pax-web -->
7674
org.ops4j.pax.web.utils;version="${pax-web.osgi.version}",
75+
org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}",
7776
org.ops4j.pax.web.service.spi.model;version="${pax-web.osgi.version}",
7877
org.ops4j.pax.web.service.spi.servlet;version="${pax-web.osgi.version}",
7978
org.ops4j.pax.web.service.spi.util;version="${pax-web.osgi.version}",
8079

8180
<!-- from pax-logging-api -->
82-
org.slf4j;version="[1.7,2)",
81+
org.slf4j;version="[2,3)",
8382
org.apache.juli.logging,
8483

8584
<!-- packages required by Jasper/EL implementation and exported from pax-web-tomcat-common -->
@@ -104,7 +103,7 @@
104103
org.eclipse.jdt.internal.compiler.problem,
105104

106105
<!-- other standard packages -->
107-
javax.annotation,
106+
jakarta.annotation,
108107
javax.naming,
109108
javax.sql;resolution:=optional,
110109
javax.xml.parsers,
@@ -135,31 +134,17 @@
135134
re-export JSP API - from mvn:org.apache.tomcat/tomcat-jsp-api
136135
(instead of from mvn:jakarta.servlet.jsp/jakarta.servlet.jsp-api)
137136
-->
138-
javax.servlet.jsp;version="2.3",
139-
javax.servlet.jsp.el;version="2.3",
140-
javax.servlet.jsp.tagext;version="2.3",
137+
jakarta.servlet.jsp;version="${dependency.jakarta.servlet.jsp-api}",
138+
jakarta.servlet.jsp.el;version="${dependency.jakarta.servlet.jsp-api}",
139+
jakarta.servlet.jsp.tagext;version="${dependency.jakarta.servlet.jsp-api}",
141140

142141
<!-- re-export JSTL API from mvn:jakarta.servlet.jsp.jstl/jakarta.servlet.jsp.jstl-api -->
143-
javax.servlet.jsp.jstl.core;version="${dependency.jakarta.servlet.jsp.jstl-api}",
144-
javax.servlet.jsp.jstl.fmt;version="${dependency.jakarta.servlet.jsp.jstl-api}",
145-
javax.servlet.jsp.jstl.sql;version="${dependency.jakarta.servlet.jsp.jstl-api}",
146-
javax.servlet.jsp.jstl.tlv;version="${dependency.jakarta.servlet.jsp.jstl-api}",
142+
jakarta.servlet.jsp.jstl.core;version="${dependency.jakarta.servlet.jsp.jstl-api}",
143+
jakarta.servlet.jsp.jstl.fmt;version="${dependency.jakarta.servlet.jsp.jstl-api}",
144+
jakarta.servlet.jsp.jstl.sql;version="${dependency.jakarta.servlet.jsp.jstl-api}",
145+
jakarta.servlet.jsp.jstl.tlv;version="${dependency.jakarta.servlet.jsp.jstl-api}",
147146

148-
<!--
149-
re-export EL Impl - from mvn:org.apache.tomcat/tomcat-jasper-el
150-
for broader picture:
151-
- org.apache.tomcat/tomcat-el-api/9.0.29 has OSGi manifest, but doesn't specify versions
152-
- org.apache.tomcat/tomcat-el-api/8.5.49 is not an OSGi bundle
153-
- org.apache.tomcat/tomcat-jasper-el/9.0.29 has OSGi manifest, but doesn't specify versions
154-
- org.apache.tomcat/tomcat-jasper-el/8.5.49 is not an OSGi bundle
155-
- org.glassfish.web/javax.el/2.2.6 (EL 2.2) exports com.sun.el.* and imports javax.el
156-
at version 2.2
157-
- org.glassfish.web/el-impl/2.2 (EL 2.2) exports com.sun.el.* and imports javax.el
158-
at version 2.2
159-
- org.glassfish/javax.el/3.0.0 (EL 3.0) exports com.sun.el.* and imports javax.el
160-
at version 3.0.0
161-
version of implementation should be not the same as the version of specification
162-
-->
147+
<!-- re-export EL Impl - from mvn:org.apache.tomcat/tomcat-jasper-el -->
163148
org.apache.el;version="${dependency.org.apache.tomcat}",
164149
org.apache.el.lang;version="${dependency.org.apache.tomcat}",
165150
org.apache.el.parser;version="${dependency.org.apache.tomcat}",
@@ -185,6 +170,7 @@
185170
impl in 2010 (http://svn.apache.org/viewvc?view=revision&revision=1026635),
186171
so we hopefuly clear the confusion in pax-web-jsp
187172
-->
173+
<!-- TODO: JakartaEE 10 -->
188174
org.apache.taglibs.standard;version="1.2",
189175
org.apache.taglibs.standard.functions;version="1.2",
190176
org.apache.taglibs.standard.tag.common.core;version="1.2",
@@ -197,14 +183,11 @@
197183
org.apache.taglibs.standard.tag.rt.xml;version="1.2",
198184
org.apache.taglibs.standard.tei;version="1.2",
199185
org.apache.taglibs.standard.tlv;version="1.2",
200-
org.apache.taglibs.standard.util;version="1.2",
201186

202-
<!-- don't re-export JSTL Impl from mvn:org.apache.taglibs/taglibs-standard-compat -->
203-
!org.apache.taglibs.standard.tag.compat.*,
204187
<!-- don't re-export JSTL Impl from mvn:org.apache.taglibs/taglibs-standard-jstlel -->
205188
!org.apache.taglibs.standard.lang.*,
206189
!org.apache.taglibs.standard.tag.el.*,
207-
!org.apache.taglibs.standard.tlv.el
190+
!org.apache.taglibs.standard.tlv
208191
</Export-Package>
209192
<Private-Package>
210193
<!-- resources from mvn:org.apache.tomcat/tomcat-jasper which are not exported (no *.class there) -->
@@ -221,8 +204,9 @@
221204
</Embed-Dependency>
222205
<_nouses>true</_nouses>
223206
<_contract>!*</_contract>
207+
<!-- TODO: JakartaEE 10 -->
224208
<Provide-Capability><![CDATA[
225-
osgi.contract;osgi.contract=JavaJSP;uses:="javax.servlet.jsp,javax.servlet.jsp.el,javax.servlet.jsp.tagext";
209+
osgi.contract;osgi.contract=JavaJSP;uses:="jakarta.servlet.jsp,jakarta.servlet.jsp.el,jakarta.servlet.jsp.tagext";
226210
version:List<Version>="2.3,2.2,2.1,2"
227211
]]></Provide-Capability>
228212
</instructions>
@@ -271,16 +255,21 @@
271255
<scope>provided</scope>
272256
</dependency>
273257

274-
<!-- JavaEE -->
258+
<!-- JakartaEE -->
275259

276260
<dependency>
277261
<groupId>jakarta.el</groupId>
278262
<artifactId>jakarta.el-api</artifactId>
279263
<scope>provided</scope>
280264
</dependency>
265+
<dependency>
266+
<groupId>jakarta.annotation</groupId>
267+
<artifactId>jakarta.annotation-api</artifactId>
268+
<scope>provided</scope>
269+
</dependency>
281270
<dependency>
282271
<!--
283-
This dependency is used instead of jakarta.servlet/jakarta.servlet-api to take javax.servlet.resources
272+
This dependency is used instead of jakarta.servlet/jakarta.servlet-api to take jakarta.servlet.resources
284273
package with XSDs/DTDs into pax-web-jsp
285274
-->
286275
<groupId>org.apache.tomcat</groupId>
@@ -289,11 +278,11 @@
289278
</dependency>
290279
<dependency>
291280
<!--
292-
This dependency is used instead of jakarta.servlet.jsp/jakarta.servlet.jsp-api to take javax.servlet.jsp.resources
281+
This dependency is used instead of jakarta.servlet.jsp/jakarta.servlet.jsp-api to take jakarta.servlet.jsp.resources
293282
package with XSDs/DTDs into pax-web-jsp and re-export these packages from pax-web-jsp:
294-
- javax.servlet.jsp
295-
- javax.servlet.jsp.el
296-
- javax.servlet.jsp.tagext
283+
- jakarta.servlet.jsp
284+
- jakarta.servlet.jsp.el
285+
- jakarta.servlet.jsp.tagext
297286
-->
298287
<groupId>org.apache.tomcat</groupId>
299288
<artifactId>tomcat-jsp-api</artifactId>
@@ -304,10 +293,10 @@
304293
This dependency provides packages to re-export from pax-web-jsp. While jakarta.servlet-api and
305294
jakarta.servlet.jsp-api can't be used (because they contain no resources), with JSTL we can use
306295
jakarta.servlet.jsp.jstl-api - also because there's no analogous org.apache.tomcat JAR.
307-
- javax.servlet.jsp.jstl.core
308-
- javax.servlet.jsp.jstl.fmt
309-
- javax.servlet.jsp.jstl.sql
310-
- javax.servlet.jsp.jstl.tlv
296+
- jakarta.servlet.jsp.jstl.core
297+
- jakarta.servlet.jsp.jstl.fmt
298+
- jakarta.servlet.jsp.jstl.sql
299+
- jakarta.servlet.jsp.jstl.tlv
311300
-->
312301
<groupId>jakarta.servlet.jsp.jstl</groupId>
313302
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
@@ -360,7 +349,9 @@
360349

361350
<dependency>
362351
<!--
363-
This dependency (JSTL implementation) provides packages to re-export from pax-web-jsp:
352+
This dependency (JSTL implementation) provides packages to re-export from pax-web-jsp. for JakartaEE8
353+
and earlier, the implementation was org.apache.taglibs:taglibs-standard-impl, but even if now
354+
it is org.glassfish.web:jakarta.servlet.jsp.jstl, the package is still org.apache.taglibs.*
364355
- org.apache.taglibs.standard
365356
- org.apache.taglibs.standard.functions
366357
- org.apache.taglibs.standard.resources (resources only)
@@ -374,10 +365,9 @@
374365
- org.apache.taglibs.standard.tag.rt.xml
375366
- org.apache.taglibs.standard.tei
376367
- org.apache.taglibs.standard.tlv
377-
- org.apache.taglibs.standard.util
378368
-->
379-
<groupId>org.apache.taglibs</groupId>
380-
<artifactId>taglibs-standard-impl</artifactId>
369+
<groupId>org.glassfish.web</groupId>
370+
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
381371
<scope>provided</scope>
382372
</dependency>
383373

@@ -436,7 +426,7 @@
436426
</dependency>
437427
<dependency>
438428
<groupId>org.apache.logging.log4j</groupId>
439-
<artifactId>log4j-slf4j-impl</artifactId>
429+
<artifactId>log4j-slf4j2-impl</artifactId>
440430
<scope>test</scope>
441431
</dependency>
442432

@@ -449,10 +439,20 @@
449439
</dependency>
450440

451441
<dependency>
452-
<groupId>junit</groupId>
453-
<artifactId>junit</artifactId>
442+
<groupId>org.junit.jupiter</groupId>
443+
<artifactId>junit-jupiter-api</artifactId>
454444
<scope>test</scope>
455445
</dependency>
446+
<dependency>
447+
<groupId>org.junit.jupiter</groupId>
448+
<artifactId>junit-jupiter-engine</artifactId>
449+
<scope>test</scope>
450+
</dependency>
451+
<dependency>
452+
<groupId>org.assertj</groupId>
453+
<artifactId>assertj-core</artifactId>
454+
<version>${dependency.org.assertj}</version>
455+
</dependency>
456456
<dependency>
457457
<groupId>org.mockito</groupId>
458458
<artifactId>mockito-core</artifactId>
@@ -461,23 +461,4 @@
461461

462462
</dependencies>
463463

464-
<profiles>
465-
<profile>
466-
<id>jdk11</id>
467-
<activation>
468-
<jdk>[9,)</jdk>
469-
</activation>
470-
<dependencies>
471-
472-
<!-- JavaEE / JakartaEE -->
473-
474-
<dependency>
475-
<groupId>jakarta.annotation</groupId>
476-
<artifactId>jakarta.annotation-api</artifactId>
477-
</dependency>
478-
479-
</dependencies>
480-
</profile>
481-
</profiles>
482-
483464
</project>

0 commit comments

Comments
 (0)