"sbt stage" does not do anything

101 views Asked by At

I'm facing an issue while trying to generate a universal folder using the 'sbt stage' command. I have a Scala project with the following build.sbt file:


name := "hod.btlg"
version := "0.0.1-SNAPSHOT"
scalaVersion := "3.3.0"
val akkaHttpVersion = "10.5.2"
val akkaVersion = "2.8.0"

// Repositories
resolvers += Resolver.mavenCentral

// this will add the ability to "stage" which is required for Heroku
enablePlugins(JavaAppPackaging)

// Dependencies
libraryDependencies += "org.scala-lang" %% "scala3-library" % "3.3.0"
libraryDependencies += "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion

// add the Akka HTTP libraries
libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-stream" % akkaVersion,
  "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
  "com.typesafe.akka" %% "akka-http" % akkaHttpVersion
)

// this specifies which class is the main class in the package
Compile / mainClass := Some("hod.btlg.Backend")

When I run 'sbt stage' in my project directory, the process completes without any error messages. However, the expected 'universal' folder is not generated. I have followed instructions that I found online, and everything seems to be correct.

"sbt run" works.

I would greatly appreciate any insights or suggestions on how to resolve this issue. Thank you in advance for your help!

1

There are 1 answers

1
Ivan Stanislavciuc On

I think you're missing the universal plugin.

Enable it with

enablePlugins(JavaAppPackaging, UniversalPlugin)

Then that stage can be generated with

sbt Universal/stage