如何将jar发布到本地存储库? [英] How to publish jar to local repository?

查看:58
本文介绍了如何将jar发布到本地存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

有没有办法在本地发布 jar 以便我可以使用 libraryDependencies += "org.xxx" % "xxx" % "1.0" 符号添加依赖项?(我已经知道如何通过将文件复制到 lib 文件夹来将文件添加到项目中.)

Is there a way to publish the jar locally so I can add the dependency using the libraryDependencies += "org.xxx" % "xxx" % "1.0" notation? (I already know how to add the file to a project by copying it to the lib folder.)

推荐答案

publishLocal 操作用于将您的项目发布到本地 Ivy 存储库.默认情况下,此本地存储库位于 ${user.home}/.ivy2/local.然后,您可以从同一台机器上的其他项目中使用该项目 source

The publishLocal action is used to publish your project to a local Ivy repository. By default, this local repository is in ${user.home}/.ivy2/local. You can then use this project from other projects on the same machine source

抱歉,我误读了您的问题.这是一个示例,用于将 jar 或源发布到您本地的 ivy 存储库.

Sorry I misread your question. Here is an example to publish a jar or sources to your local ivy repo.

这篇关于如何将jar发布到本地存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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