Skip to content

Commit 5e6ed0e

Browse files
committed
[#1802] Switch samples-httpservice from javax to jakarta
1 parent 855affb commit 5e6ed0e

File tree

36 files changed

+197
-158
lines changed

36 files changed

+197
-158
lines changed

samples/samples-httpservice/authentication/pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
<instructions>
4444
<Bundle-Activator>org.ops4j.pax.web.samples.authentication.internal.Activator</Bundle-Activator>
4545
<Import-Package>
46-
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
47-
javax.servlet;version="[3.1,5)",
48-
javax.servlet.http;version="[3.1,5)",
46+
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
47+
jakarta.servlet;version="[6,7)",
48+
jakarta.servlet.http;version="[6,7)",
4949

50-
<!-- ranges indicate we can work with OSGi Core R6+ -->
51-
org.osgi.framework;version="[1.8,2)",
50+
<!-- OSGi Core R8+ -->
51+
org.osgi.framework;version="[1.10,2)",
5252
org.osgi.util.tracker;version="[1.5,2)",
5353

54-
<!-- OSGi cmpn -->
55-
org.osgi.service.http;version="[1.2,2)"
54+
<!-- pax-web-api -->
55+
org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}"
5656
</Import-Package>
5757
<Export-Package />
5858
<Private-Package>org.ops4j.pax.web.samples.authentication.*</Private-Package>
@@ -64,6 +64,14 @@
6464

6565
<dependencies>
6666

67+
<!-- pax-web own artifacts -->
68+
69+
<dependency>
70+
<groupId>org.ops4j.pax.web</groupId>
71+
<artifactId>pax-web-api</artifactId>
72+
<scope>provided</scope>
73+
</dependency>
74+
6775
<!-- OSGi -->
6876

6977
<dependency>
@@ -73,11 +81,11 @@
7381
</dependency>
7482
<dependency>
7583
<groupId>org.osgi</groupId>
76-
<artifactId>osgi.cmpn</artifactId>
84+
<artifactId>org.osgi.service.servlet</artifactId>
7785
<scope>provided</scope>
7886
</dependency>
7987

80-
<!-- JavaEE -->
88+
<!-- JakartaEE -->
8189

8290
<dependency>
8391
<groupId>jakarta.servlet</groupId>

samples/samples-httpservice/authentication/src/main/java/org/ops4j/pax/web/samples/authentication/AuthHttpContext.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import java.io.IOException;
1919
import java.net.URL;
2020
import java.util.Base64;
21-
import javax.servlet.http.HttpServletRequest;
22-
import javax.servlet.http.HttpServletResponse;
2321

24-
import org.osgi.service.http.HttpContext;
22+
import jakarta.servlet.http.HttpServletRequest;
23+
import jakarta.servlet.http.HttpServletResponse;
24+
import org.ops4j.pax.web.service.http.HttpContext;
2525

2626
/**
2727
* Created by IntelliJ IDEA. User: alin.dreghiciu Date: Dec 10, 2007 Time:

samples/samples-httpservice/authentication/src/main/java/org/ops4j/pax/web/samples/authentication/StatusServlet.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717

1818
import java.io.IOException;
1919
import java.io.PrintWriter;
20-
import javax.servlet.ServletException;
21-
import javax.servlet.http.HttpServlet;
22-
import javax.servlet.http.HttpServletRequest;
23-
import javax.servlet.http.HttpServletResponse;
24-
25-
import org.osgi.service.http.HttpContext;
20+
import jakarta.servlet.ServletException;
21+
import jakarta.servlet.http.HttpServlet;
22+
import jakarta.servlet.http.HttpServletRequest;
23+
import jakarta.servlet.http.HttpServletResponse;
24+
import org.ops4j.pax.web.service.http.HttpContext;
2625

2726
public class StatusServlet extends HttpServlet {
2827

samples/samples-httpservice/authentication/src/main/java/org/ops4j/pax/web/samples/authentication/internal/Activator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
import org.ops4j.pax.web.samples.authentication.AuthHttpContext;
2222
import org.ops4j.pax.web.samples.authentication.StatusServlet;
23+
import org.ops4j.pax.web.service.http.HttpService;
2324
import org.osgi.framework.BundleActivator;
2425
import org.osgi.framework.BundleContext;
25-
import org.osgi.service.http.HttpService;
2626
import org.osgi.util.tracker.ServiceTracker;
2727

2828
/**

samples/samples-httpservice/hs-1/pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
<instructions>
4444
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.hs1.internal.Activator</Bundle-Activator>
4545
<Import-Package>
46-
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
47-
javax.servlet;version="[3.1,5)",
48-
javax.servlet.http;version="[3.1,5)",
46+
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
47+
jakarta.servlet;version="[6,7)",
48+
jakarta.servlet.http;version="[6,7)",
4949

50-
<!-- ranges indicate we can work with OSGi Core R6+ -->
51-
org.osgi.framework;version="[1.8,2)",
50+
<!-- OSGi Core R8+ -->
51+
org.osgi.framework;version="[1.10,2)",
5252
org.osgi.util.tracker;version="[1.5,2)",
5353

54-
<!-- OSGi cmpn -->
55-
org.osgi.service.http;version="[1.2,2)"
54+
<!-- pax-web-api -->
55+
org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}"
5656
</Import-Package>
5757
<Export-Package />
5858
<Private-Package>org.ops4j.pax.web.samples.helloworld.hs1.internal</Private-Package>
@@ -64,6 +64,14 @@
6464

6565
<dependencies>
6666

67+
<!-- pax-web own artifacts -->
68+
69+
<dependency>
70+
<groupId>org.ops4j.pax.web</groupId>
71+
<artifactId>pax-web-api</artifactId>
72+
<scope>provided</scope>
73+
</dependency>
74+
6775
<!-- OSGi -->
6876

6977
<dependency>
@@ -73,11 +81,11 @@
7381
</dependency>
7482
<dependency>
7583
<groupId>org.osgi</groupId>
76-
<artifactId>osgi.cmpn</artifactId>
84+
<artifactId>org.osgi.service.servlet</artifactId>
7785
<scope>provided</scope>
7886
</dependency>
7987

80-
<!-- JavaEE -->
88+
<!-- JakartaEE -->
8189

8290
<dependency>
8391
<groupId>jakarta.servlet</groupId>

samples/samples-httpservice/hs-1/src/main/java/org/ops4j/pax/web/samples/helloworld/hs1/internal/Activator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package org.ops4j.pax.web.samples.helloworld.hs1.internal;
1717

18+
import org.ops4j.pax.web.service.http.HttpService;
1819
import org.osgi.framework.BundleActivator;
1920
import org.osgi.framework.BundleContext;
2021
import org.osgi.framework.ServiceReference;
21-
import org.osgi.service.http.HttpService;
2222
import org.osgi.util.tracker.ServiceTracker;
2323
import org.osgi.util.tracker.ServiceTrackerCustomizer;
2424

samples/samples-httpservice/hs-1/src/main/java/org/ops4j/pax/web/samples/helloworld/hs1/internal/HelloWorldServlet.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import java.io.IOException;
1919
import java.io.PrintWriter;
20-
import javax.servlet.http.HttpServlet;
21-
import javax.servlet.http.HttpServletRequest;
22-
import javax.servlet.http.HttpServletResponse;
20+
import jakarta.servlet.http.HttpServlet;
21+
import jakarta.servlet.http.HttpServletRequest;
22+
import jakarta.servlet.http.HttpServletResponse;
2323

2424
public class HelloWorldServlet extends HttpServlet {
2525

samples/samples-httpservice/hs-2/pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
<instructions>
4444
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.hs2.internal.Activator</Bundle-Activator>
4545
<Import-Package>
46-
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
47-
javax.servlet;version="[3.1,5)",
48-
javax.servlet.http;version="[3.1,5)",
46+
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
47+
jakarta.servlet;version="[6,7)",
48+
jakarta.servlet.http;version="[6,7)",
4949

50-
<!-- ranges indicate we can work with OSGi Core R6+ -->
51-
org.osgi.framework;version="[1.8,2)",
50+
<!-- OSGi Core R8+ -->
51+
org.osgi.framework;version="[1.10,2)",
5252
org.osgi.util.tracker;version="[1.5,2)",
5353

54-
<!-- OSGi cmpn -->
55-
org.osgi.service.http;version="[1.2,2)"
54+
<!-- pax-web-api -->
55+
org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}"
5656
</Import-Package>
5757
<Export-Package />
5858
<Private-Package>org.ops4j.pax.web.samples.helloworld.hs2.internal</Private-Package>
@@ -64,6 +64,14 @@
6464

6565
<dependencies>
6666

67+
<!-- pax-web own artifacts -->
68+
69+
<dependency>
70+
<groupId>org.ops4j.pax.web</groupId>
71+
<artifactId>pax-web-api</artifactId>
72+
<scope>provided</scope>
73+
</dependency>
74+
6775
<!-- OSGi -->
6876

6977
<dependency>
@@ -73,11 +81,11 @@
7381
</dependency>
7482
<dependency>
7583
<groupId>org.osgi</groupId>
76-
<artifactId>osgi.cmpn</artifactId>
84+
<artifactId>org.osgi.service.servlet</artifactId>
7785
<scope>provided</scope>
7886
</dependency>
7987

80-
<!-- JavaEE -->
88+
<!-- JakartaEE -->
8189

8290
<dependency>
8391
<groupId>jakarta.servlet</groupId>

samples/samples-httpservice/hs-2/src/main/java/org/ops4j/pax/web/samples/helloworld/hs2/internal/Activator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package org.ops4j.pax.web.samples.helloworld.hs2.internal;
1717

18+
import org.ops4j.pax.web.service.http.HttpService;
1819
import org.osgi.framework.BundleActivator;
1920
import org.osgi.framework.BundleContext;
2021
import org.osgi.framework.ServiceReference;
21-
import org.osgi.service.http.HttpService;
2222
import org.osgi.util.tracker.ServiceTracker;
2323
import org.osgi.util.tracker.ServiceTrackerCustomizer;
2424

samples/samples-httpservice/hs-2/src/main/java/org/ops4j/pax/web/samples/helloworld/hs2/internal/HelloWorldServlet.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import java.io.IOException;
1919
import java.io.PrintWriter;
20-
import javax.servlet.http.HttpServlet;
21-
import javax.servlet.http.HttpServletRequest;
22-
import javax.servlet.http.HttpServletResponse;
20+
import jakarta.servlet.http.HttpServlet;
21+
import jakarta.servlet.http.HttpServletRequest;
22+
import jakarta.servlet.http.HttpServletResponse;
2323

2424
public class HelloWorldServlet extends HttpServlet {
2525

samples/samples-httpservice/hs-for-war-default/pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
<instructions>
4444
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.Activator</Bundle-Activator>
4545
<Import-Package>
46-
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
47-
javax.servlet;version="[3.1,5)",
48-
javax.servlet.http;version="[3.1,5)",
46+
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
47+
jakarta.servlet;version="[6,7)",
48+
jakarta.servlet.http;version="[6,7)",
4949

50-
<!-- ranges indicate we can work with OSGi Core R6+ -->
51-
org.osgi.framework;version="[1.8,2)",
50+
<!-- OSGi Core R8+ -->
51+
org.osgi.framework;version="[1.10,2)",
5252
org.osgi.util.tracker;version="[1.5,2)",
5353

54-
<!-- OSGi cmpn -->
55-
org.osgi.service.http;version="[1.2,2)"
54+
<!-- pax-web-api -->
55+
org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}"
5656
</Import-Package>
5757
<Export-Package>org.ops4j.pax.web.samples.helloworld</Export-Package>
5858
</instructions>
@@ -63,6 +63,14 @@
6363

6464
<dependencies>
6565

66+
<!-- pax-web own artifacts -->
67+
68+
<dependency>
69+
<groupId>org.ops4j.pax.web</groupId>
70+
<artifactId>pax-web-api</artifactId>
71+
<scope>provided</scope>
72+
</dependency>
73+
6674
<!-- OSGi -->
6775

6876
<dependency>
@@ -72,11 +80,11 @@
7280
</dependency>
7381
<dependency>
7482
<groupId>org.osgi</groupId>
75-
<artifactId>osgi.cmpn</artifactId>
83+
<artifactId>org.osgi.service.servlet</artifactId>
7684
<scope>provided</scope>
7785
</dependency>
7886

79-
<!-- JavaEE -->
87+
<!-- JakartaEE -->
8088

8189
<dependency>
8290
<groupId>jakarta.servlet</groupId>

samples/samples-httpservice/hs-for-war-default/src/main/java/org/ops4j/pax/web/samples/helloworld/Activator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package org.ops4j.pax.web.samples.helloworld;
1717

18+
import org.ops4j.pax.web.service.http.HttpService;
1819
import org.osgi.framework.BundleActivator;
1920
import org.osgi.framework.BundleContext;
2021
import org.osgi.framework.ServiceReference;
21-
import org.osgi.service.http.HttpService;
2222
import org.osgi.util.tracker.ServiceTracker;
2323
import org.osgi.util.tracker.ServiceTrackerCustomizer;
2424

samples/samples-httpservice/hs-for-war-default/src/main/java/org/ops4j/pax/web/samples/helloworld/HelloWorldServlet.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import java.io.IOException;
1919
import java.io.PrintWriter;
20-
import javax.servlet.http.HttpServlet;
21-
import javax.servlet.http.HttpServletRequest;
22-
import javax.servlet.http.HttpServletResponse;
20+
import jakarta.servlet.http.HttpServlet;
21+
import jakarta.servlet.http.HttpServletRequest;
22+
import jakarta.servlet.http.HttpServletResponse;
2323

2424
public class HelloWorldServlet extends HttpServlet {
2525

samples/samples-httpservice/hs-helloworld/pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
<instructions>
4444
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.hs.internal.Activator</Bundle-Activator>
4545
<Import-Package>
46-
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
47-
javax.servlet;version="[3.1,5)",
48-
javax.servlet.http;version="[3.1,5)",
46+
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
47+
jakarta.servlet;version="[6,7)",
48+
jakarta.servlet.http;version="[6,7)",
4949

50-
<!-- ranges indicate we can work with OSGi Core R6+ -->
51-
org.osgi.framework;version="[1.8,2)",
50+
<!-- OSGi Core R8+ -->
51+
org.osgi.framework;version="[1.10,2)",
5252
org.osgi.util.tracker;version="[1.5,2)",
5353

54-
<!-- OSGi cmpn -->
55-
org.osgi.service.http;version="[1.2,2)"
54+
<!-- pax-web-api -->
55+
org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}"
5656
</Import-Package>
5757
<Export-Package />
5858
<Private-Package>org.ops4j.pax.web.samples.helloworld.hs.internal</Private-Package>
@@ -64,6 +64,14 @@
6464

6565
<dependencies>
6666

67+
<!-- pax-web own artifacts -->
68+
69+
<dependency>
70+
<groupId>org.ops4j.pax.web</groupId>
71+
<artifactId>pax-web-api</artifactId>
72+
<scope>provided</scope>
73+
</dependency>
74+
6775
<!-- OSGi -->
6876

6977
<dependency>
@@ -73,11 +81,11 @@
7381
</dependency>
7482
<dependency>
7583
<groupId>org.osgi</groupId>
76-
<artifactId>osgi.cmpn</artifactId>
84+
<artifactId>org.osgi.service.servlet</artifactId>
7785
<scope>provided</scope>
7886
</dependency>
7987

80-
<!-- JavaEE -->
88+
<!-- JakartaEE -->
8189

8290
<dependency>
8391
<groupId>jakarta.servlet</groupId>

samples/samples-httpservice/hs-helloworld/src/main/java/org/ops4j/pax/web/samples/helloworld/hs/internal/Activator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
import java.util.Dictionary;
1919
import java.util.Hashtable;
2020

21+
import org.ops4j.pax.web.service.http.HttpContext;
22+
import org.ops4j.pax.web.service.http.HttpService;
2123
import org.osgi.framework.BundleActivator;
2224
import org.osgi.framework.BundleContext;
2325
import org.osgi.framework.ServiceReference;
24-
import org.osgi.service.http.HttpContext;
25-
import org.osgi.service.http.HttpService;
2626
import org.osgi.util.tracker.ServiceTracker;
2727
import org.osgi.util.tracker.ServiceTrackerCustomizer;
2828

0 commit comments

Comments
 (0)