Tags:

    Two Great Applications: Hudson and Artifactory

    As mentioned in the previous entry I was setting up a build system for my current project. I tried out Anthill (community and Pro version), Cruisecontrol, Continuum and TeamCity (Jet Brain) and now I tried out Hudson. Personally I would prefer TeamCity but that is not open-source even though there is a free version available. But right after that come Hudson which is easy to use, easy to setup and works quite nicely. The only shortcoming of Hudson compared to TeamCity is that a build is one job and if I build different releases of the same project I would need to duplicate the jobs which is not a biggy but if you change VCS or alike then you need to change that in all jobs using that.

    Setting up Hudson is as easy as dropping the WAR file into a deploy directory and optionally setting the directory in the environment variable HUDSON_HOME where Hudson should keep its data. Then fire up the web server, log into http://localhost<:port>/hudson and you are in business. It is a good idea to specify JAVA_HOME so that Maven does not fail if you use Maven. Go to the Manage Hudson -> Configure System and set the paths to Maven and Ant. Then create your first job and hit build now, done.

    In order to make it easier on developers to use not publicly available Maven artifacts like ojdbc, quartz or even Flex SDK it would be great to have an internal Maven repository. This way such artifacts only need to be uploaded once and not per developer. Earlier I just created a directory listings in a web server but now I found a tool that is easier to use and can even speed up download time by caching remote artifacts on its server. This tool is called Artifactory by jFrog.org. It is a little bit more difficult to setup but it is worth the effort.

    First download the tool from jFrog.org's website and put it into the deploy directory of your web server. Then adjust the web server configuration and I use JBoss here which needs only some minor tweaks on the run.conf file inside the <jboss.home>/bin directory. First increase the JVM's available memory and also set the Perm Size otherwise you will run out of memory:

    -Xms512m -Xmx1024m -XX:MaxPermSize=128m

    Then you need to tell JBoss to use the JVM MBeanServer with:

    -Djboss.platform.mbeanserver

    Now you can fire up JBoss, open http://localhost<:port>/artifactory<-version number> and log in as amin/password.

    First I created a local repository (in the admin tab) to make sure I can deploy my own artifacts there including artifacts not available in public Maven repositories. Then I uploaded (in the deploy tab) these artifacts. Then I added some additional remote repository according to my POMs. Finally I added my local and all the necessary remote repositories into the already defined virtual repository called remote-repos. The idea is that I can use one repository in the POM's repository list instead of listing them all one by one. Now if I add this repository in the POMs as the top repository and keep the previous repository in the POM listed below I will be able to access the public Maven repository even when I am outside of the internal repository's network.

    Beside that I can browse the repositories, search for artifacts quick and easily and even remove cached stuff. Overall that tool is good as gold and does a great job.

    Have fun - Andy