tindzk / seed

Build tool for Scala projects
https://tindzk.github.io/seed/
Apache License 2.0
238 stars 13 forks source link

Missing jar after running `seed bloop` #109

Closed ckipp01 closed 3 years ago

ckipp01 commented 4 years ago

I was using seed today for a small project with lihaoyi/cask. The server is actually unable to be run due to the following exception:

ⓘ Exception in thread "main" java.lang.IllegalArgumentException: XNIO001001: No XNIO provider found
ⓘ   at org.xnio.Xnio.doGetInstance(Xnio.java:270)
ⓘ   at org.xnio.Xnio.getInstance(Xnio.java:187)
ⓘ   at io.undertow.Undertow.start(Undertow.java:117)
ⓘ   at cask.main.Main.main(Main.scala:57)
ⓘ   at core.MinimalApplication.main(Main.scala)

Looking at the dependencies of cask I see both xnio-api and xnio-nio:

❯ cs resolve com.lihaoyi:cask_2.13:0.6.7
com.lihaoyi:cask-util_2.13:0.6.7:default
com.lihaoyi:cask_2.13:0.6.7:default
com.lihaoyi:castor_2.13:0.1.3:default
com.lihaoyi:fansi_2.13:0.2.9:default
com.lihaoyi:geny_2.13:0.6.0:default
com.lihaoyi:pprint_2.13:0.5.9:default
com.lihaoyi:sourcecode_2.13:0.2.1:default
com.lihaoyi:ujson_2.13:1.1.0:default
com.lihaoyi:upack_2.13:1.1.0:default
com.lihaoyi:upickle-core_2.13:1.1.0:default
com.lihaoyi:upickle-implicits_2.13:1.1.0:default
com.lihaoyi:upickle_2.13:1.1.0:default
io.undertow:undertow-core:2.0.13.Final:default
org.java-websocket:Java-WebSocket:1.4.0:default
org.jboss.logging:jboss-logging:3.3.2.Final:default
org.jboss.xnio:xnio-api:3.3.8.Final:default
org.jboss.xnio:xnio-nio:3.3.8.Final:default
org.scala-lang:scala-library:2.13.2:default
org.scala-lang:scala-reflect:2.13.2:default
org.scala-lang.modules:scala-collection-compat_2.13:2.1.4:default
org.slf4j:slf4j-api:1.7.25:default

Running bloopInstall with either sbt or Mill end up having both of these listed in the project.classpath in the .bloop/<module>.json file. However, after running seed bloop, xnio-nio seems to be missing and not on the classpath causing the exception up above. So I'm not really sure what is happening, but it looks like it's just being excluded for some reason when it probably shouldn't be.

tindzk commented 3 years ago

Thanks for the report and apologies for taking so long to look into it! I could reproduce the bug. The bug occurs because the xnio-nio dependency in the POM file uses the runtime scope, causing Coursier to omit it. Since Mill also uses Coursier, it is likely the bug has been fixed in more recent versions. I will upgrade the code base from Coursier v1.1.0-M14-4 to v2.0.7.