scalatra / scalatra

Tiny Scala high-performance, async web framework, inspired by Sinatra
http://scalatra.org
Other
2.64k stars 335 forks source link

Update Jetty to latest version ("javax" and "jakarta" flavors) #1678

Closed dalbani closed 1 month ago

dalbani commented 1 month ago

As one can see in the MR opened by @scala-steward-bot for the update to Jetty 12.0.8, something changed in this version of Jetty: it appears that passing a path to non-existent resource base directory is not allowed anymore.
https://github.com/scalatra/scalatra/pull/1662/checks#step:4:8808

[info] org.scalatra.jetty.JettyServerSpec *** ABORTED ***
[info]   java.lang.IllegalArgumentException: Base Resource is not valid: file:///home/runner/work/scalatra/scalatra/src/main/webapp
[info]   at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:716)
[info]   at org.eclipse.jetty.ee10.servlet.ServletContextHandler.startContext(ServletContextHandler.java:1316)
[info]   at org.eclipse.jetty.ee10.servlet.ServletContextHandler.lambda$doStart$0(ServletContextHandler.java:1042)
[info]   at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1237)
[info]   at org.eclipse.jetty.ee10.servlet.ServletContextHandler.doStart(ServletContextHandler.java:1039)
[info]   at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
[info]   at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
[info]   at org.eclipse.jetty.server.Server.start(Server.java:622)

This MR updates Jetty for both the javax and jakarta to the latest version at the time of writing, plus make the necessary adjustment in Scalatra to be compatible with the change in Jetty 12.0.8.

dalbani commented 1 month ago

Note to self: org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.x depends on version 6 of the Servlet API, where Scalatra mentions jakarta.servlet:jakarta.servlet-api:5.0.0 in Dependencies.scala.

Edit: implemented in https://github.com/scalatra/scalatra/pull/1678/commits/0cb59a7f991b248fb45b95085dccd259ebaf9fa1.

dalbani commented 1 month ago

Thanks a lot @magnolia-k for your very prompt reaction 👍 As I mentioned in #1675, would you mind releasing milestone 3.1.0-M2 so that I can test the change contained in this PR in a real world deployment?

dalbani commented 1 month ago

Hey @magnolia-k, I hope you're doing fine. Let me know if I can help with a release of 3.1.0-M2. Thanks!