如何使用常春藤本地存储库作为Maven存储库 [英] How to use the ivy local repository as a maven respository

查看:52
本文介绍了如何使用常春藤本地存储库作为Maven存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

常春藤本地存储库位于〜/.ivy2中,我想将其用作本地Maven仓库.有没有像设置这样的简单方法?

The ivy local repository is in ~/.ivy2, and I'd like to use it as my local maven respoitory. Is there any easy way like setting to do it ?

推荐答案

我怀疑您要尝试共享的是常春藤的缓存,而不是本地存储库.通过调用发布任务,将文件放置在ivy的存储库中. . Ivy在以下文件类型之间有明显的存储区别:

I suspect what you're trying to do is share ivy's cache, not it's local repository. Files are placed in ivy's repository by calling the publish task. Ivy has a clear storage distinction between these file types:

~/.ivy2/cache
~/.ivy2/local

Maven则将以下目录中的两种文件类型混合在一起:

Maven on the other hand mixes up both file types under the following directory:

~/.m2/repository

通过安装Maven存储库管理器(例如 Nexus )和配置Maven和Ivy以使用它. Nexus 是一个非常有效的Java流程,可以在您的开发计算机上轻松设置.

It would be a lot simpler to optimize your caching by installing a Maven repository manager like Nexus and configuring Maven and Ivy to use it. Nexus is a very efficient java process and simple to setup on your development machine.

最后,如果您决定共享缓存,则可以尝试使用缓存指令.它具有"ivyPattern"和"artifactPattern"指令,建议您可以自定义缓存文件的存储方式.为了使这项工作,您必须自定义常春藤. Maven在这方面没有灵活性.

Finally if you are determined to share caches, you could attempt to use the caches directive in the ivy settings file. It has "ivyPattern" and "artifactPattern" directives which suggest one can customize how the cached files are stored. To make this work you'll have to customize ivy. Maven has no flexibility in this area.

这篇关于如何使用常春藤本地存储库作为Maven存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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