tindzk / seed

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

JVM resources are not copied into jar #106

Closed hohonuuli closed 4 years ago

hohonuuli commented 4 years ago

tl;dr

Files in the resource directory are not being copied into the built jar file.

the sordid details

I've set up a project that mimics a sbt/maven layout (src/main/scala, src/main/resources, etc). The source for the project is at https://github.com/hohonuuli/demoseed. In this project there is a resource file at src/main/resources/logback.xml. My module is configured like so:

[module.demoseed.jvm]
root = "."
resources = [
  "src/main/resources"
]
sources = [
  "src/main/scala",
  "src/main/java"
]
scalaDeps = [
  ["io.circe", "circe-core", "0.13.0"]
]

I ran the following:

seed all
seed package demoseed --libs

Everything compiles just fine, but I can't find the logback.xml file from resources in the built jar. e.g.

❯ jar -tvf build/dist/demoseed.jar
   702 Mon Jun 22 17:39:16 PDT 2020 META-INF/MANIFEST.MF
     0 Mon Jun 22 17:39:14 PDT 2020 demoseed/
   925 Mon Jun 22 17:39:14 PDT 2020 demoseed/Main$.class
   301 Mon Jun 22 17:39:14 PDT 2020 demoseed/Foo.class
   635 Mon Jun 22 17:39:14 PDT 2020 demoseed/Main.class

At this point, I can't tell if this is a bug in seed or if I've missed some configuration. Any help is appreciated. (BTW, seed is pretty cool!)

tindzk commented 4 years ago

Thanks for the detailed bug report! I agree that package should copy resource files too. #108 will fix this.