Saturday, November 22, 2008

ant, ivy, archiva, maven

I have been looking into how to use ivy to manage dependencies during an ant build. And this caused me to look at apache archiva. It is possible to use ant without archiva but unless one has a local maven mirror this will involve ivy going to an internet maven repo, which can consume alot of network bandwidth. I think this is the point of archiva, to have it as a local maven mirror when ivy finds the jar is not in its cache. Apparently, it can all be configured so that archiva is dynamically updated with missing components by takening them from a maven repo.

I tried and tried to get archiva working but I just could not do it. I've no idea what I am doing wrong. I got so cheesed off that in desperation I set up a jar+pom repo on my own workstations web pages. Ivy has no problem reaching those. This seems to make archiva redundant. Given that once the jar has been located ivy can be configured to put it in a cache, this does make me wonder what the point is of archiva.

Another weirdness I found, whch has got me really cheesed off with archiva and maven, is the state of the poms in the maven mirrors that I found. The mirrors seem to be a complete mess, with most things in the wrong places. For example xstream from thoughtworks is at the top level, and in org/codehaus and com/thoughtworks. Also the pom files always have a group name with dots instead of slashes. This tends to cause the download to give a flat directory structure. I manually set up structures for my web pages that keep the package structure in the jars. This meant I had to hack the poms to fix the group names. Of course this would not work with archiva since these changes would require a recalculation of the sha1 values. I'm glad I don't have to do that.

So, I've got something that works for me. It does involves alot of manual work to find the right jar file in a maven repo, given all the redudant copies in other parts of the tree. And I have to edit practically every pom file I download to avoid getting a completely flat directory structure. But this is price I am willing to pay to have a web space structure that follows the java package structure exactly for all the jars I have.

4 comments:

Andrew Marlow said...

It doesn't work for me. I have just found out that there is a cascading chain of dependencies and pom files to fix with that approach.

I tried to create a maven mirror by doing a recursive wget of maven.atlassian.com/repository/public but this didn't work either. It rurns out that several maven repos are done as archiva repos and these do not behave as you would want when you wget them. The pom and sha1 files come over ok but the jars are left behind!

This is turning into a very knotty problem.

Andrew Marlow said...

Actually, I left the wget download running overnight and it did eventually download all the jars. So now I just need to find out how to populate an archiva repo based on what I have downloaded.

Andrew Marlow said...

After several months of using ivy I have now decided that ivy is a pile of poo. I have been told that for ant projects that use ivy they should consider moving to maven.

Anonymous said...

A new episode of "The Bible" series was aired on the History Channel, March 17th, 20130. This premiere concluded the Old Testament and introduced the New Testament. So far 6 of the 10 hours of series have been completed with only four more hours to be completed in the next 2 episodes.

Although some texts were removed in the original Bible, what do you think the tv show would be like, if it aired the removed texts?
One removed book includes the Testament of Simeon