Closed jrlemieux closed 7 months ago
This doesn't seem to be an issue with Mill. When I run an example project, it is able to start and I can access the website just fine:
First shell
$ wget https://github.com/com-lihaoyi/cask/releases/download/0.9.1/minimalApplication-0.9.1.zip
--2024-01-14 08:03:43-- https://github.com/com-lihaoyi/cask/releases/download/0.9.1/minimalApplication-0.9.1.zip
lihaoyi test$ unzip minimalApplication-0.9.1.zip
lihaoyi test$ cd minimalApplication-0.9.1
lihaoyi minimalApplication-0.9.1$ ./mill show app.assembly
"ref:9269ba96:/Users/lihaoyi/test/minimalApplication-0.9.1/out/app/assembly.dest/out.jar"
lihaoyi minimalApplication-0.9.1$ /Users/lihaoyi/test/minimalApplication-0.9.1/out/app/assembly.dest/out.jar
Another shell
lihaoyi ~$ curl localhost:8080
Hello World!%
Maybe something funny with the SBT config you're using, SBT-assembly, or SBT itself?
I am building my project with SBT and I have these dependencies and assembly rules that appear below. When I run the program with this command, using my fat jar tts.jar, I get an exception:
Somehow, some xnio-nio classes needed by undertow are not appended to the generated assembly.
The issue can be fixed by supplying two jar files in the classpath, such as:
Some lines from build.sbt
The name of the xnio-nio jar file to be appended to the class path can be found with this script. There might be a better way to achieve this, but here is what worked for me:
This is not a bug in Cask, but I would recommend that this issue should be documented because anyone building with SBT will likely hit it.