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

查看:478
本文介绍了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文件,如果你有一个生成的sbt项目jar,它应该像调用publish-local一样简单,将jar发布到你的本地ivy存储库,这样你就可以在另一个项目中(在同一台计算机上)使用该jar。

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天全站免登陆