Wednesday, March 19, 2008

Something about the proximity problems I had.

It's been 4-5 days on and off I am trying the Maven Repository products to get working with Apache ServiceMix 3.2 build and test.

Goal: To get Apache ServiceMix 3.2 build and test working.

I think I should summarize the experience as I am pretty much giving up on them (or probably not but not sure yet). One thing is sure I liked the exercise even though frustrating some times.

1. Proximity :
* With no longer in development and Subversion repository, wiki, forums gone it is hard to get the bundle. I manage to get it from Bruce Snyder's Proximity blog entry.
* Hard to configure as no documentation around. (Thanks to Bruce Snyder for helping out)

Problems I faced are:
1. After adding the required bean entries and FSStores and Remote Peer locations It didn't work.
2. So tried sequencing the entries based on preference and updated for each beam entry accordingly.
3. After fixing this got the Repository logic properties wrong on some entires, fixed that and still proximity wouldn't try all the repositories listed.
4. After lot of time (without any docs) found that I was putting all the repository entries in separate group and as per my settings.xml maven was only requesting on public group so modified the configuration and updated for all required entries to public.
5. At this stage got maven to talk to the repositories and here I hit the big problem (may be a bug in proximity) for some of the dependencies which are available in more than one repositories it was corrupting the Jar files and POM files. This caused builds to fail on invalid POM and jar file. The POM file of the artifact in the local repository was replaced by some kind of Proximity generated artifact summary.

At this stage I gave up and moved on.

Nice to have: Some documentation around configuration, UI for adding or editing configuration. Hand editing the XML configuration is error-prone task.

Apache Archiva 1.0.1:
Similar to Proximity had some configuration issues. Didn't know need to add proxy connector for each repository entry. Once the repository entries, connectors and all entries in one group I was hit by a issue of cookies didn't like the url name of some of my entries saying they do not confirm to RFC2109. It didn't talk to that repository at all. Tried putting IP address but no luck archiva would resolve it and skip the repository with same error.
Result: Stopped experimenting.

One strong point is the ability to configure using UI in browser. It makes it much easier to view and edit configuration compared to other 2.

Nice to have: Little more speed in download artifacts. Found it slow even for cached artifacts. And also the fix/workaround (or visible documentation somewhere if it exists) for the RFC 2109 error.

Artifacotry 1.2.5 :
After playing with this I even if the build was not successful I started liking it for the speed of the downloads especially compared to Archiva. With some more efforts and configuration I got Artifactory to talk to all the repositories I wanted. It also gave the same RFC2109 error so changed to IP address and it still showed the error but was able to contact the repository alright.
Next issue was grouping and search order. From documentation page I manage to find out the search order and learned about the VirtualRepo. So Added new virtualRepo and added reference to my repository entries in the order I wanted.
So far so good stared downloading artifacts etc. but still my end goal was failure .

Even after so much trying out and tweaking the configuration the end result still was build failure, until while writing this blog entry I found the problem and after correcting it got it to work the way I wanted with successful build.

The final piece of the puzzle to get artifactory work the way I wanted was to add the exclusion for maven-plugins in apache.snapshots entry in configuration.

Lack of this exclusion was causing the build to pickup latest snapshot release and somewhere down the line the rest of the maven plugins picked up were either unstable or non-existent versions. I suspect this also would have been the problems with other 2 experiments also but anyway the other bug in Proximity still would mess -up the artifacts.

Next goal is to get the Apache CXF building with the same setup which I am 95% sure will work.

Monday, March 17, 2008

Nothing work for me , Archiva, Artifactory or Proxima

I am starting to feel like most dumb person as per my Blog title. After struggling for so many days managed to get the artifactory running I stumbled upon the problem of no legacy layout for maven repositories like so had to give up on this.
Next tried Archiva again and somwhere down the line my build doesn't find the requred maven-resources-plugin. No matter how I set it up it just doesn't like the setup and give up.

After these 2 option gone I turned back to proximity. After repeat configurations and getting build to download dependencies now I am seeing funny results from proximity for Some dependency POM files which gets replaced with some kind of artifact summary written by Proximity and also the corresponding jar file gets corrupted.

I still haven't given up on the setup. hoping to get something going soon. Let's see if I succeed or completely give up.

Sunday, March 16, 2008

No Archiva, no Proximity now trying artifacotry

I don't know what went wrong in my setup of Archiva and proximity it doesn't like to download maven-plugin-plugin whatever I do. After lot of time spent on it I decided to give a try to Artifactory again. As expected, failed on startup but got fixed and currently trying to do a Build for Apache ServiceMix 3.2.2 using Artifactory.
One thing I found from these exercise is the domain name doesn't confirm to RFC2109 so httpClient reject cookies. Also, it was rejecting to connect to it for artifact download. I had to do a ping and replace the name with IP address in configuration. The next problem I hit was due to mistake in entering the IP Address. (I am half blind at 1:30 a.m. due to lack of sleep but can't stop playing with this exercise)

I am hoping that atleast Artifacotry would work for me. I found it slightly faster also in downloading artifacts thanArchiva and Proximity.(Unless it just sleeps on some blocked connection or with NoRouteToHostException due to bad repo address url in which case it sleeps for 60 sec. on Linux)
One more problem I saw in my Artifactory setup is if I kill it won't shutdown fast enough and clean fashion I almost always had to kill java process.

I am hoping to get it working today. One big achievement is that I managed to get it talking to all the repositories I configured in configuration file.

Saturday, March 15, 2008

short-lived happiness of archiva

My happiness of getting Apache maven-archiva to work was short lived one. I wanted to see it working again with clean local maven repository and it now hangs. I even tried deleting archiva data directory to populate it fresh but no use mvn clean simply blocks and archiva even after adding admin user and giving repository management rights to default guest account pretend to have not received any communication from maven (atleast from the log at debug level)

Friday, March 14, 2008

My experiments of setting up Apache Archiva and proximity

From last 3 - 4 days I was playing with Apache Archiva 1.0.1, Proximity and artifactory.

One thing I found in common is the trouble to get it setup and lack of basic documentation or sample configuration.
After playing so long and spending long nights breaking my head over it finally mange to get Apache Archiva configured for my maven based projects.Initially I got proximity setup successful for Apache CXF build but couldn't get it to work with ServiceMix builds so started looking at artifactory. It was sure easy enough to get started with artifactory but soon I hit a problem where it won't like my repository mirror names and started rejecting them with cookie problems saying host-domain cannot contain "." character.

Finally got Archiva working with our inhouse Maven mirrors and external repositories.

I had to play around a lot and do the following things to let the Archiva talk to external mirrors.
1. I had to add repository proxy connectors for each of them.(which was expected)
2. Change managed repository to internal (snapshots which is shown in default selection didn't work for me.
3. Had to add */** pattern for WhiteList in proxy connector.
4. Biggest of all and most annoying part (since it took long time to find out) was to mark the java-net repository as maven 1.x repository because it has propitiatory directory structure which doesn't follow maven2 style.

After all this (looks to small to write but took 3-4 days to experiment in spare time) finally got Archiva to work.

Now next exercise is to clean local maven repository and run the builds. Also, would be interesting is to point repositories to nfs share if possible to speed up caching.

I guess whatever I wrote is not too useful so I might do another post with sample proximity configuration with public repositories.
The whole reason for this blogging exercise was to record it somewhere for later reference as I struggled to find the example configurations.

First Experience of Blogging

This is my first blog.
I felt I should record all the sensible (and more non-sensible) stuff, so that others can look at it and even I can refer to it again as I tend to forget things that I did to get something working .

Intention is to cover the low-tech stuff, mainly my crap experiments at work and home.

I should say, I am not a good writer (and my spelling/grammar is not good) so bare with me if there are any mistakes. I feel expressing the contents matters to me more than the style, spelling and grammar.