Skip to content

Commit

Permalink
Upgrade to Tomcat 10 and Servlet 5
Browse files Browse the repository at this point in the history
  • Loading branch information
rossabaker committed Jun 19, 2022
1 parent 6d62ca5 commit 90331ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ThisBuild / tlBaseVersion := "0.24" // your current series x.y
ThisBuild / tlBaseVersion := "0.25" // your current series x.y

ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(
Expand All @@ -15,10 +15,10 @@ ThisBuild / scalaVersion := Scala213 // the default Scala

val asyncHttpClientVersion = "2.12.3"
val http4sVersion = "0.23.12"
val http4sServletVersion = "0.24.0-M1"
val http4sServletVersion = "0.25.0-M1"
val munitCatsEffectVersion = "1.0.7"
val servletApiVersion = "4.0.1"
val tomcatVersion = "9.0.64"
val servletApiVersion = "5.0.0"
val tomcatVersion = "10.0.22"

lazy val root = project
.in(file("."))
Expand All @@ -32,7 +32,7 @@ lazy val tomcatServer = project
description := "Tomcat implementation for http4s servers",
startYear := Some(2014),
libraryDependencies ++= Seq(
"javax.servlet" % "javax.servlet-api" % servletApiVersion % Provided,
"jakarta.servlet" % "jakarta.servlet-api" % servletApiVersion % Provided,
"org.apache.tomcat" % "tomcat-catalina" % tomcatVersion,
"org.apache.tomcat" % "tomcat-coyote" % tomcatVersion,
"org.apache.tomcat" % "tomcat-util-scan" % tomcatVersion,
Expand Down
11 changes: 5 additions & 6 deletions examples/src/main/scala/com/example/TomcatExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@
package com.example

import cats.effect._
import jakarta.servlet.FilterChain
import jakarta.servlet.http.HttpFilter
import jakarta.servlet.http.HttpServlet
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.http4s._
import org.http4s.server.Server
import org.http4s.tomcat.server.TomcatBuilder

import javax.servlet.FilterChain
import javax.servlet.http.HttpFilter
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

/** 1. Run as `sbt examples/run`
* 2. Browse to http://localhost:8080/http4s to see `httpRoutes`
* 3. Browse to http://localhost:8080/raw to see a raw servlet alongside the http4s routes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ package server

import cats.effect._
import cats.effect.std.Dispatcher
import jakarta.servlet.DispatcherType
import jakarta.servlet.http.HttpFilter
import jakarta.servlet.http.HttpServlet
import org.apache.catalina.Context
import org.apache.catalina.connector.Connector
import org.apache.catalina.startup.Tomcat
Expand All @@ -45,9 +48,6 @@ import org.log4s.getLogger
import java.net.InetSocketAddress
import java.util
import java.util.concurrent.Executor
import javax.servlet.DispatcherType
import javax.servlet.http.HttpFilter
import javax.servlet.http.HttpServlet
import scala.collection.immutable
import scala.concurrent.duration._

Expand Down

0 comments on commit 90331ea

Please sign in to comment.