Skip to content

Commit

Permalink
Switch from xsbt-web-plugin to sbt-war, from javax to jakarta.servlet
Browse files Browse the repository at this point in the history
  • Loading branch information
whym committed Nov 2, 2024
1 parent c2fcf9c commit c1ef102
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This application has a number of parameters that are set by a configuration file

==== Using the web interface

. `sbt "~Tomcat / start"&`
. `sbt "~WarStart` # see https://index.scala-lang.org/earldouglas/sbt-war
. `xdg-open http://localhost:8080` # or open http://localhost:8080 on your browser

==== Using the multiple sequence aligner
Expand Down
9 changes: 5 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libraryDependencies ++= Seq(
"com.carrotsearch" % "jsuffixarrays" % "0.1.0",
"net.java.dev.jna" % "jna" % "5.6.0",
"org.apache.commons" % "commons-text" % "1.9",
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided",
"jakarta.servlet" % "jakarta.servlet-api" % "6.0.0" % Provided,
"org.scala-lang.modules" %% "scala-xml" % "2.0.1",
("org.scala-lang.modules" %% "scala-collection-contrib" % "0.2.2").cross(CrossVersion.for3Use2_13),
"org.json4s" %% "json4s-native" % "4.0.4",
Expand All @@ -24,12 +24,12 @@ publishMavenStyle := true

publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))

enablePlugins(TomcatPlugin)
enablePlugins(SbtWar)

lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin).
settings(
scalaVersion := "3.4.2",
scalaVersion := "3.5.2",
organization := "org.whym",
name := "growthring",
version := "0.7-SNAPSHOT",
Expand All @@ -47,6 +47,7 @@ lazy val root = (project in file(".")).
java.time.Instant.now()
}),
buildInfoPackage := "org.whym.growthring",
buildInfoOptions += BuildInfoOption.ToMap
buildInfoOptions += BuildInfoOption.ToMap,
warPort := 8080
)

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4")
addSbtPlugin("com.earldouglas" % "sbt-war" % "5.0.0-M4")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
4 changes: 2 additions & 2 deletions src/main/scala/org/whym/growthring/servlets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package org.whym.growthring

import scala.jdk.CollectionConverters.*
import javax.servlet.http.{HttpServlet, HttpServletRequest, HttpServletResponse}
import javax.servlet.ServletConfig
import jakarta.servlet.http.{HttpServlet, HttpServletRequest, HttpServletResponse}
import jakarta.servlet.ServletConfig
import org.json4s.{JObject, JField, JArray, JValue, JInt}
import org.json4s.native.JsonMethods.*
import org.json4s.JsonDSL.*
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/test-servlets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.whym.growthring._
import scala.jdk.CollectionConverters._
import org.scalatest.funsuite.AnyFunSuite
import java.io.{ Writer, PrintWriter, StringWriter }
import javax.servlet.http.{ HttpServlet, HttpServletRequest, HttpServletResponse }
import jakarta.servlet.http.{ HttpServlet, HttpServletRequest, HttpServletResponse }
import org.mockito.Mockito._
import org.scalatestplus.mockito.MockitoSugar
import org.json4s.{ JInt, JString, JField, JObject, JArray, JValue }
Expand Down

0 comments on commit c1ef102

Please sign in to comment.