How to add lib with jars to shared folder?

谁说我不能喝 提交于 2019-12-23 04:28:18

问题


I have a cross building scala-js project with a client, server and shared folder. If I add a lib folder with some jars in the server project folder I can reference the classes in the jars in my server code. But if add the lib folder in the shared project folder I can't reference the classes in my shared code. Can I add some command in my sbt build file to get my jars visible in my shared project or what should I do?


回答1:


.jars should never be shared, since it is not the same .jar for Scala/JVM and Scala.js, even if they have the same source code.

If you have the two .jars for JVM and JS, you can put them in shared/jvm/lib/ and shared/js/lib/, respectively.

(if you use .crossType(CrossType.Pure), use .jvm/.js instead of jvm/js)



来源:https://stackoverflow.com/questions/46744383/how-to-add-lib-with-jars-to-shared-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!