Patching maven

I was hoping to make a release of Candy for AppFuse this weekend, but seems like I follwed an unexplored path, so I’ve spent some time paving the way.

As you might now, AppFuse 2.0 is built on top of maven, so Candy for AppFuse needs to integrate with maven too. For doing that, I’ve chosen the m2eclipse plug-in, which happens to bundle an snapshot of the 2.1.x maven embedder (currently, the official maven version is 2.0.6, so you can see this is quite experimental).

The 2.1 branch can handle 2.0 poms without problems (at least, I’m not aware of any), and provides extra features like transfer listeners, which allow (for example) to track the progress downloading the dependencies.

Candy for AppFuse 0.2.0 had some indication of progress, but creating a new AppFuse project with an empty local maven repository takes quite a bit, so I wanted to enhance it with more information (like the artifact being downloaded and the percentage downloaded so far).

What I noticed after some time hacking at this feature was that maven’s code allows to specify a transfer listener per request. But the listener is kept forever by maven! That’s probably not noticeable when running from the command line (I assume it would be only one request per execution), but when embedded, the transfer listeners start to pile up.

This bug had already been seen by m2eclipse users, but I couldn’t see it reported to the maven core maintainers.

So I prepared a test case, a patch and attached both to a new issue. Ah… how good it feels to help 😉 .

Now I get my patched copy and try to use it with Candy for AppFuse, but there was no luck. The version I patched (latest from SVN) had some changes in the maven-embedder that broke the warpath plugin in AppFuse.

I would have liked to have a patch for that as well, but I only had the time to open a new issue.

When coming back from Ireland I’ll give this another round.

%d bloggers like this: