sbt:如何将本地文件系统 jar 添加到我的项目中? [英] sbt: How can I add a local filesystem jar to my project?

查看:43
本文介绍了sbt:如何将本地文件系统 jar 添加到我的项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个编译成 jar(不是 sbt 项目,只是 jar 文件)的库,该库在存储库中不可用.

I have a library compiled to a jar (not an sbt project, just the jar file) that's not available on a repository.

有没有一种简单的方法可以直接在文件系统/项目中添加对jar的引用?

Is there a simple way to add a reference to the jar in the filesystem/project directly?

推荐答案

您可以将 jar 放在项目的 lib 文件夹中(如果不存在则创建它),然后它将出现在项目的非托管类路径中.

You can put the jar in your project's lib folder (create it if it doesn't exist), it will then appear on your project's unmanaged-classpath.

要在本地发布 jar 文件,如果你有一个生成 jar 的 sbt 项目,它应该像调用publish-local"一样简单,将 jar 发布到本地 ivy 存储库,这样你就可以在您的另一个项目(在同一台计算机上).

To publish a jar file locally, if you have an sbt project that produces the jar, it should be as simple as invoking "publish-local" to publish the jar to your local ivy repository so that you can use that jar in another one of your projects (on the same computer).

这篇关于sbt:如何将本地文件系统 jar 添加到我的项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆