Ivy

1. What's Ivy?
Ivy is a tool for managing (recording, tracking, resolving and reporting) project dependencies.

3 types of repositories: Local, Share & Public

2. Configuration file
ivy.xml: defines module's info (org, module properties), configurations, dependencies & publications.

ivysetting.xml: properties(some properties for the Ivy process), settings(initializes some parameters for the Ivy process), resolvers(defines the resolvers to use), modules(configure which resolver should be used for which module).

eg.
<publications>
    <artifact name="filter-api" type="jar"  conf="api" ext="jar"/>
    <artifact name="filter-hmimpl" type="jar"  conf="homemade-impl" ext="jar"/>
        <artifact name="filter-ccimpl" type="jar"  conf="cc-impl" ext="jar"/>   
</publications>
In the publications tag, we defined the artifacts we produce (jars in this case) and we assign them to a configuration. When others use our library they will have a flexible way to ask for what they need.

3. Resolve, Retrieve
Resolve: ivy actually resolves the dependencies of one module. It first needs to access the ivy file of the module for which it resolves the dependencies. Then, for each dependency declared in this file, it asks the appropriate resolver (according to settings) to find the module.
When the dependency module has been found, its ivy file is downloaded to the ivy cache. Then ivy checks if the dependency module has dependencies, in which case it recursilvely traverses the graph of dependencies.

Retrieve: copying artifacts from the cache to another directory structure.

ivy:deliver
1) generate a resolved ivy file
2) do recursive delivery

ivy:publish
Publishes the current module's artifacts and the resolved descriptor (delivered ivy file)

猜你喜欢

转载自silverend.iteye.com/blog/2306931
Ivy