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

1

0

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.

Headmaster answered 16/4, 2012 at 9:1 Comment(3)
Why exactly do you want that? Why don't you want the libraries from a public repository?Lyckman
is it possible to use local jars ? because for some jars its giving me not found on repository.. :(and this jars are importantHeadmaster
possible duplicate of sample example which explain how to use filesystem resolverHawes
L
0

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

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" />
Lyckman answered 16/4, 2012 at 9:54 Comment(3)
@Headmaster actually I can't because I don't know anything about your environment, the tools you use, how your build.xml looks like. What your ivy.xml looks like. There is not enough detail here to provide a walkthrough.Lyckman
i am directly adding ivy.xml to build path through add add library so when anyone import my project from svn and add the library to their buld path it is downloading all the dependencies into the cache and later on use this from cache..Headmaster
@Headmaster please use the edit button below the question to add ALL relevant information. And you should also specify that you use IvyDE under Eclipse.Lyckman

© 2022 - 2024 — McMap. All rights reserved.