Skip to content

Commit

Permalink
[#1802] Switch samples-httpservice from javax to jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
grgrzybek committed Jun 21, 2023
1 parent a286943 commit dbde49a
Show file tree
Hide file tree
Showing 36 changed files with 197 additions and 158 deletions.
26 changes: 17 additions & 9 deletions samples/samples-httpservice/authentication/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
<instructions>
<Bundle-Activator>org.ops4j.pax.web.samples.authentication.internal.Activator</Bundle-Activator>
<Import-Package>
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)",
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
jakarta.servlet;version="[6,7)",
jakarta.servlet.http;version="[6,7)",

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

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

<dependencies>

<!-- pax-web own artifacts -->

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- OSGi -->

<dependency>
Expand All @@ -73,11 +81,11 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<artifactId>org.osgi.service.servlet</artifactId>
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import java.io.IOException;
import java.net.URL;
import java.util.Base64;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.osgi.service.http.HttpContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.ops4j.pax.web.service.http.HttpContext;

/**
* Created by IntelliJ IDEA. User: alin.dreghiciu Date: Dec 10, 2007 Time:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.osgi.service.http.HttpContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.ops4j.pax.web.service.http.HttpContext;

public class StatusServlet extends HttpServlet {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import org.ops4j.pax.web.samples.authentication.AuthHttpContext;
import org.ops4j.pax.web.samples.authentication.StatusServlet;
import org.ops4j.pax.web.service.http.HttpService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTracker;

/**
Expand Down
26 changes: 17 additions & 9 deletions samples/samples-httpservice/hs-1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
<instructions>
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.hs1.internal.Activator</Bundle-Activator>
<Import-Package>
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)",
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
jakarta.servlet;version="[6,7)",
jakarta.servlet.http;version="[6,7)",

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

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

<dependencies>

<!-- pax-web own artifacts -->

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- OSGi -->

<dependency>
Expand All @@ -73,11 +81,11 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<artifactId>org.osgi.service.servlet</artifactId>
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package org.ops4j.pax.web.samples.helloworld.hs1.internal;

import org.ops4j.pax.web.service.http.HttpService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class HelloWorldServlet extends HttpServlet {

Expand Down
26 changes: 17 additions & 9 deletions samples/samples-httpservice/hs-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
<instructions>
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.hs2.internal.Activator</Bundle-Activator>
<Import-Package>
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)",
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
jakarta.servlet;version="[6,7)",
jakarta.servlet.http;version="[6,7)",

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

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

<dependencies>

<!-- pax-web own artifacts -->

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- OSGi -->

<dependency>
Expand All @@ -73,11 +81,11 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<artifactId>org.osgi.service.servlet</artifactId>
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package org.ops4j.pax.web.samples.helloworld.hs2.internal;

import org.ops4j.pax.web.service.http.HttpService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class HelloWorldServlet extends HttpServlet {

Expand Down
26 changes: 17 additions & 9 deletions samples/samples-httpservice/hs-for-war-default/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
<instructions>
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.Activator</Bundle-Activator>
<Import-Package>
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)",
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
jakarta.servlet;version="[6,7)",
jakarta.servlet.http;version="[6,7)",

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

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

<dependencies>

<!-- pax-web own artifacts -->

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- OSGi -->

<dependency>
Expand All @@ -72,11 +80,11 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<artifactId>org.osgi.service.servlet</artifactId>
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package org.ops4j.pax.web.samples.helloworld;

import org.ops4j.pax.web.service.http.HttpService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class HelloWorldServlet extends HttpServlet {

Expand Down
26 changes: 17 additions & 9 deletions samples/samples-httpservice/hs-helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
<instructions>
<Bundle-Activator>org.ops4j.pax.web.samples.helloworld.hs.internal.Activator</Bundle-Activator>
<Import-Package>
<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)",
<!-- ranges indicate Servlet API 6.0+ (JakartaEE 10+) -->
jakarta.servlet;version="[6,7)",
jakarta.servlet.http;version="[6,7)",

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

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

<dependencies>

<!-- pax-web own artifacts -->

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- OSGi -->

<dependency>
Expand All @@ -73,11 +81,11 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<artifactId>org.osgi.service.servlet</artifactId>
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import java.util.Dictionary;
import java.util.Hashtable;

import org.ops4j.pax.web.service.http.HttpContext;
import org.ops4j.pax.web.service.http.HttpService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

Expand Down
Loading

0 comments on commit dbde49a

Please sign in to comment.