Why sbt compile doesn't copy unmanaged resources to classpath?

前端 未结 1 964
执念已碎
执念已碎 2021-02-14 05:28

Could you tell me why sbt compile doesn\'t copy unmanaged resources to classpath? On the other hand sbt package does. As result I can\'t start debuggin

相关标签:
1条回答
  • 2021-02-14 06:09

    The job of compile is to compile sources, so it won't typically do anything related to processing resources. However, the resources need to be in the class directory for run, package, test, console, and anything else that uses the fullClasspath. This is done by fullClasspath combining exportedProducts, which are the classes and resources generated by the current project, and dependencyClasspath, which are the classpath entries from dependencies.

    The appropriate solution depends on what needs the resources. From the command line, run exported-products to do a compile as well as copy-resources. Programmatically, you will typically want to depend on fullClasspath or exportedProducts.

    As a side note, you can typically find out what tasks do what using the inspect command.

    0 讨论(0)
提交回复
热议问题