初始开发期间如何在Clojure库中使用本地存储库? [英] How to use a local repository for a Clojure library during initial development?

查看:58
本文介绍了初始开发期间如何在Clojure库中使用本地存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于开发Clojure库的问题,有关库开发和分发的建议工作流中未解决此问题,如下所述:

I have a question about developing a Clojure library which is not answered in the suggested workflow for Library Development and Distribution as described here: http://clojure-doc.org/articles/ecosystem/libraries_authoring.html

我正在开发一个库,并想在clojure项目中对此进行测试.在这个项目中,我将不得不添加正在开发的库作为依赖项.是否可以使用"lein deploy clojars"替代方案,将我的库部署到本地存储库?如果是这样,我将如何在测试项目中设置:dependencies?请注意,我将在clojars中使用库,并且在我用来测试正在开发的库的项目中也将使用库.

I am developing a library and want to test this in a clojure project. In this project I will have to add the library under development as a dependency. Is there an alternative for 'lein deploy clojars' which will deploy my library to a local repository? If so how would I setup :dependencies for this in the test project? Note that I will be using libraries in clojars as well in the project which I use to test the library under development.

因此,我应该将开发中的Clojure库部署到本地存储库中的哪个位置,以便Alpha测试该库的项目可以使用它.测试项目应如何解决这个问题.我想知道这会如何影响1)库开发项目的project.clj文件和2)测试正在开发中的库的项目的project.clj文件.

So where should I deploy a Clojure library in development to, a local repository perhaps, such that it can be used by projects which alpha test the library. How should the test projects address this. I would like to know how this affects 1) the project.clj file for the library development project and 2) the project.clj file for the project which tests the library in development.

推荐答案

lein install完成任务:

$ lein install -h
Install jar and pom to the local repository; typically ~/.m2.

在您的图书馆项目中执行lein install,您的图书馆jar和pom文件将安装在~/.m2目录下.

In your library project execute lein install and your library jar and pom files will be installed under the ~/.m2 directory.

之后,当您构建另一个依赖于库的项目时,lein将在~/.m2中找到其二进制文件.

After that when you build another project that depends on your library, lein will find its binaries in ~/.m2.

~/.m2是本地Maven存储库的默认位置,它是lein在依赖关系解析期间使用的位置之一.它还可以用作远程存储库的缓存,其中存储了从Maven Central或Clojars下载的工件.

~/.m2 is a default location of the local Maven repository which is one of the locations used by lein during dependency resolution. It also works as a cache for remote repositories where artifacts downloaded from Maven Central or Clojars are stored.

这篇关于初始开发期间如何在Clojure库中使用本地存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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