How do I use a local folder as an ivy repository?

喜夏-厌秋 提交于 2019-12-25 03:26:40

问题


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.

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.


回答1:


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} is the folder, where your ivysettings.xml is located.

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

<ivy:settings />

or

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


来源:https://stackoverflow.com/questions/10171254/how-do-i-use-a-local-folder-as-an-ivy-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!