如何将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.