maven and canoo webtest pitfall

Today, I spent about 2 hours to find out why our canoo webtests didn’t run anymore after adding the webDAV wagon to our maven build.

The problem was that when adding the webDAV-wagon to your build as an extension, you also get the commons-httpclient dependency to the maven runtime classpath. This wouldn’t be too bad, but the 1.0-beta2 version of the webDAV-wagon depends on commons-httpclient version 2.0.2. That’s way too old for canoo webtest and is also deprecated for almost a year now.

I found out that starting with maven 2.0.9 you don’t need to have an explicit reference to the webDAV-wagon as extension anymore.

E voilĂ ! Suddenly it worked. Maven 2.0.9 also seems to work with version 3.1 of commons-httpclient, the same version canoo webtest depends on.

So, if you get a ‘NoSuchMethodFound’ for HttpConnectionManager.getParams() first check if you’re using the webDAV-wagon extension first.

Gallery Included

I also included a small gallery to the site. The gallery content comes from my images server through a php script and the presentation is done using jQuery with livequery and slimbox2.

I had to use livequery because I wanted to add a lightbox effect to the asynchronously loaded DOM for the gallery content. That’s a common problem when dealing with ajax.

This is how it looks like now:

<head>
    <script type="text/javascript" src="http://js.madnet.ch/jquery-min.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/madnet-common.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/madnet-wordpress.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/jquery.livequery.js"></script>
    <script type="text/javascript" src="http://js.madnet.ch/slimbox/js/slimbox2.js"></script>
</head>
...
jQuery( function() {
    $("#g .gallery").livequery(function() {
        $(this).children("a").slimbox();
    });
    $("#g .galleryContainer").livequery(function() {
        $(this).click(function() {
            $(this).children(".gallery").slideToggle("slow");
        });
        $(this).children(".gallery").slideUp("slow");
        $(this).children("h3").hover(function() {
            $(this).fadeOut(100);$(this).fadeIn(500);
        });
    });
    $("#g").load("/galleryImages/AllImages.php");
});