Post Format

Does anyone read the Ivy documentation?

Leave a Reply

I know there are write-only-programming-languages, but isn’t there write-only documentation as well? Case at hand: The Apache Ivy documentation.

Some years ago I stumbled upon Ivy and we tried to use it to replace our home grown Ant solution. But after some weeks we simply gave up, nobody but our in-house build guru could understand it and he refrained from supporting the build, if it used Ivy. Some month later, we/he gave in. I am not sure this was a wise move.

Now, searching again for something less convoluted than Maven, I am looking into Gradle and Buildr (interestingly all but Gradle are part of Apache).

Since Gradle uses Ivy, I took another look at it, i.e at its documentation:

<project xmlns:ivy="antlib:org.apache.ivy.ant" name="hello-ivy" default="run">
...
<target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve />
</target>
</project>

“[…] Note that in this case we define a “resolve” target and call the retrieve task. This may sound confusing, actually the retrieve task performs a resolve (which resolves dependencies and downloads them to a cache) followed by a retrieve (a copy of those file in a local project directory)”

Yes, it sounds confusing. I had to read that twice, just to be sure I haven’t simply garbled the sentence in my head. We have a resolve target and a retrieve task that performs a resolve. Why isn’t the “resolve” target simply called “retrieve”? But directly after that sentence, there is the rescue: “Check the How does it work ? page for details about that.” Let’s move on.

First, we see a great looking image:

and then (explaining “resolve”):

“The resolve time is the moment when ivy actually resolve 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 configuration) to find the module (i.e. either an ivy file for it, or its artifacts if no ivy file can be found). It also uses a filesystem based cache to avoid asking for a dependency if it is already in cache (at least if possible, which is not the case with latest revisions).”

I am not a native speaker, so I won’t try to fix this gobbledegook, but please could someone review this text. I think it is nearly unchanged (or even more complicated) than some years ago. But if i understand it correctly, “resolve” does retrieve the files from the enterprise repository to the cache. “retrieve” then copies them to the project workspace:

“What is called retrieve in ivy is the fact to copy artifacts from the cache to another directory structure. This is done using a pattern, which indicates to ivy where the files should be copied.

For this, ivy uses the xml report in cache corresponding to the module it should retrieve to know which artifacts should be copied.”

Ok, I give up.

Leave a Reply

Required fields are marked *.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s