blog-2025-02-14-java-dokploy-nixpacks
yesterday i ran into troubles deploying my current side project [filemure].
my current dev stack is:
* [kotlin]: language
* [javalin]: web framework
* [gradle]: build system
* [dokploy]: hosting
* [nixpacks]: building a docker image
and
* [sqldelight]: database wrapper
* [tempolin]: html templating
i ran into a few problems this time, compared to when i worked on [pepperino]:
1. don't forget to make it a fat jar by including john engelman's _shadow_. i think it's not necessary to change the build command, but `build` creates both a thin and a fat jar and then it might not be clear which one of the two the `start.cmd` selects.
2. if it's a multi module project, either copy the jar to root `build/libs` directory (which is where nixpacks looks by default), or overrule it in the nixpacks config
```toml
providers = ["java"]
# add shadowJar
[phases.build]
cmds = ["chmod +x gradlew", "./gradlew clean shadowJar -x check -x test"]
# new path, and we can know the actual jar name
[start]
cmd = "java $JAVA_OPTS -jar app/build/libs/app-all.jar"
```
edited by: stefs at Tuesday, February 18, 2025, 9:59:04 AM Coordinated Universal Time
view