Skip to content

Commit

Permalink
Merge pull request #1277 from softwaremill/fix-assembly
Browse files Browse the repository at this point in the history
Fix sbt-assembly
  • Loading branch information
adamw authored Aug 2, 2024
2 parents ef469c8 + bad6199 commit 00e14ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,14 @@ lazy val fatJarSettings = Seq(
assembly / assemblyJarName := "bootzooka.jar",
assembly := assembly.dependsOn(copyWebapp).value,
assembly / assemblyMergeStrategy := {
case PathList(ps @ _*) if ps.last endsWith "io.netty.versions.properties" => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "pom.properties" => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "scala-collection-compat.properties" => MergeStrategy.first
// SwaggerUI: https://tapir.softwaremill.com/en/latest/docs/openapi.html#using-swaggerui-with-sbt-assembly
case PathList("META-INF", "maven", "org.webjars", "swagger-ui", "pom.properties") => MergeStrategy.singleOrError
case PathList("META-INF", "resources", "webjars", "swagger-ui", _*) => MergeStrategy.singleOrError
// other
case PathList(ps @ _*) if ps.last endsWith "io.netty.versions.properties" => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "pom.properties" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last endsWith "module-info.class" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last endsWith "okio.kotlin_module" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
Expand Down
2 changes: 1 addition & 1 deletion docs/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: "Production deployment"
To build an executable jar, simply run (in sbt) `backend/assembly` (that is, the `assembly` task in the `backend` subproject). This will create a fat-jar with all the code, processed javascript, css and html. You can run the jar simply by running java:

```
java -jar backend/target/scala-3/bootzooka.jar
java -jar backend/target/scala-VERSION/bootzooka.jar
```

## Docker
Expand Down

0 comments on commit 00e14ed

Please sign in to comment.