Skip to content

Commit 426c075

Browse files
committed
applications(scala): update instructions
1 parent be144d4 commit 426c075

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

content/doc/applications/scala.md

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ aliases:
2828

2929
## Overview
3030

31-
Clever Cloud allows you to deploy Scala (and Java) applications built with SBT. This document will explain you how to set up your app to run it on our service.
32-
33-
If you're looking to deploy a [Play Framework](https://www.playframework.com) application, you can have a look at our dedicated [deployment guide for play framework applications](/guides/play-framework-2)
31+
Clever Cloud allows you to deploy Scala (and Java) applications built with SBT. This document will explain you how to set up your app to run it on our service. If you're looking to deploy a [Play Framework](https://www.playframework.com) application, you can have a look at our dedicated [deployment guide](/guides/play-framework-2).
3432

3533
{{% content "create-application" %}}
3634

@@ -41,56 +39,44 @@ If you're looking to deploy a [Play Framework](https://www.playframework.com) ap
4139
### Mandatory configuration
4240

4341
Your application has to listen on port `8080` for worldwide connections (`0.0.0.0`). We set the system variable `http.port` to `8080` for you so in many cases (like for play applications) you don't have anything to do.
44-
You need to use the [sbt-native-packager](#the-sbt-native-packager) in your project.
45-
46-
### The sbt-native-packager
4742

48-
We rely on `sbt-native-packager` to run applications. This plugin provides a `stage` task which is run during deployment.
43+
### sbt Native Packager
4944

50-
If your project doesn't already use [sbt-native-packager](https://github.com/sbt/sbt-native-packager), you need to add it to `project/plugins.sbt`. Please make sure you use an up-to-date version.
51-
52-
In `project/plugins.sbt`:
45+
We rely on [sbt-native-packager](https://github.com/sbt/sbt-native-packager) to run applications. This tool automates project build and provides a `stage` task which is run during deployment. To use it, add this line to `project/plugins.sbt` (with an up-to-date version):
5346

5447
```scala
55-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.0")
48+
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.4")
5649
```
5750

58-
Then you need to configure the package type:
59-
60-
In `build.sbt`:
51+
Then you need to enable the package in `build.sbt`:
6152

6253
```scala
6354
enablePlugins(JavaAppPackaging)
6455

65-
# Disable javadoc packaging
66-
mappings in (Compile, packageDoc) := Seq()
56+
// Disable javadoc packaging to speed up the build
57+
Compile / packageDoc / mappings := Seq()
6758
```
6859

69-
For more information, please have a look at the [documentation for sbt-native-packager](https://www.scala-sbt.org/sbt-native-packager/index.html)
60+
For more information, please have a look at the [sbt-native-packager documentation](https://www.scala-sbt.org/sbt-native-packager/index.html)
7061

71-
#### Custom sbt goal
62+
#### sbt custom goal
7263

73-
By default, the deployment system execute `sbt stage` and runs the first binary found into `/target/universal/stage/bin`. If you want to run another goal, you can specify it with the `SBT_DEPLOY_GOAL` [environment variable](#setting-up-environment-variables-on-clever-cloud).
64+
By default, the deployment system executes `sbt stage` and runs the first binary found into `/target/universal/stage/bin`. If you want to run another goal, you can specify it with the `SBT_DEPLOY_GOAL` [environment variable](#setting-up-environment-variables-on-clever-cloud).
7465

7566
#### Multi-module build
7667

77-
If you have a single repository with multiple modules or want to build a specific module in a monorepo (and no top-level `stage` task), then you can specify the sbt task with `SBT_DEPLOY_GOAL`.
78-
79-
`CC_SBT_TARGET_DIR` must be set to the relative path of the module and `CC_SBT_TARGET_BIN` to the name of the binary to run.
80-
81-
For instance, if you want to deploy a module named `service1` that produce a binary named "my-binary", you have to define the following variables:
68+
If you have a single repository with multiple modules or if you want to build a specific module in a monorepo (with no top-level `stage` task), you must set `SBT_DEPLOY_GOAL`, `CC_SBT_TARGET_DIR`, and `CC_SBT_TARGET_BIN`. For instance, if you want to deploy a module named `service1` that produces a binary named "my-binary", configuration should be:
8269

8370
```shell
8471
SBT_DEPLOY_GOAL=service1/stage
8572
CC_SBT_TARGET_DIR=service1
8673
CC_SBT_TARGET_BIN=my-binary
8774
```
8875

89-
Check details on [environment variables](#setting-up-environment-variables-on-clever-cloud).
90-
91-
Our engine will execute the `sbt service1/stage` and will run `service1/target/universal/stage/bin/my-binary`
76+
The build command is `sbt service1/stage` and the application is started with `service1/target/universal/stage/bin/my-binary`.
9277

93-
**Note:** even when `CC_RUN_COMMAND` is configured `CC_SBT_TARGET_DIR` and `CC_SBT_TARGET_BIN` should be set to the correct values.
78+
> [!NOTE]
79+
> Even when `CC_RUN_COMMAND` is configured, `CC_SBT_TARGET_DIR` and `CC_SBT_TARGET_BIN` should be set to the correct values.
9480
9581
### HOCON users
9682

0 commit comments

Comments
 (0)