如何使用本地文件夹作为常春藤存储库? [英] How do I use a local folder as an ivy repository?

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

问题描述

如果我的项目lib文件夹中已经有jar文件,并且我想将该文件夹用作我的存储库,而不是将其下载并安装到我的iv2/local文件夹中,该怎么办?

What if I have already jars in my project lib folder and I want to use that folder as my repository instead of downloading and install it into my iv2/local folder.

现在,它首次将罐子从Maven下载到我的本地存储库.在存储库中找不到某些jar,但是我将它们放在lib文件夹中,并且会从那里检索它们.

Right now its first downloading jars from maven to my local repository. Some jars are not found in the repository, but I have them in a lib folder and would lie to retrieve them from there.

推荐答案

您需要创建 ivysettings.xml ,您在其中定义两个中的>解析器:

You need to create an ivysettings.xml where you define two resolvers in a chain:

  • FileSystemResolver
  • Maven Repository Resolver

可能看起来像这样(来自链解析器的示例:

This could look like this (Example from the chain resolver:

<ivysettings>
    <resolvers>

          <chain name="test">
            <filesystem name="1">
              <ivy pattern="${ivy.settings.dir}/lib/[organisation]/[module]/ivys/ivy-[revision].xml"/>
              <artifact pattern="${ivy.settings.dir}/lib/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
            </filesystem>
            <ibiblio name="maven2" m2compatible="true"/>
          </chain>  
    </resolvers>

</ivysettings>

${ivy.settings.dir}是ivysettings.xml所在的文件夹.

${ivy.settings.dir} is the folder, where your ivysettings.xml is located.

要在build.xml中包含/设置ivysettings.xml,您需要使用设置任务:

To include / set an ivysettings.xml in your build.xml you need to use the settings task:

<ivy:settings />

<ivy:settings file="path_to_file/ivysettings.xml" />

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

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