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.

   
   
           

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)

你可能感兴趣的:(Ivy)