Friday, February 22, 2008

Maven + Artifactory + Continuum

All right then - so I set up my very own (i.e. my team's) Continuous Integration environment. I used:

I installed the whole environment on Linux machine with Java 5.0. I started with Maven 2 and Apache Tomcat 6.x.
Next I downloaded Artifactory and Continuum WAR's and changed their names to artifactory.war and continuum.war accordingly (basically I removed version info).
Then I copied those two WAR's wo TOMCAT_HOME/webapps directory.
Next I configured Atrifactory and Continuum according to their documentation pages - I didn't change anything. It's pretty straightforward.
I also created empty web application TOMCAT_HOME/webapps/projects whose goal is to serve deployed maven sites. This application should have configured WebDAV interface. In order to do this I created WEB-INF/web.xml file for this webapp with following contents:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns=""

<display-name>Webdav Content Management</display-name>
Webdav Content Management

<!-- Uncomment this to enable read and write access -->



<!-- The mapping for the webdav servlet -->

<web-resource-name>The Entire Web Application</web-resource-name>

<realm-name>Tomcat Supported Realm</realm-name>

An example role defined in "conf/tomcat-users.xml"

I also had to add tomcat user to TOMCAT_HOME/conf/tomcat-users.xml:

<?xml version='1.0' encoding='utf-8'?>
<user username="admin" password="your_password" roles="admin"/>

Continuous Integration environment is almost ready.

My pom.xml contains following configuration:

<!-- Deployment config -->
<name>Internal Release Repository</name>
<name>Internal Snapshot Repository</name>

and Maven on the server side contains following configuration (MAVEN_HOME/conf/settings.xml):


Please note that artifactory admin has albo be present in Tomcat's tomcat-users.xml configuration file.
In my configuration for Artifactory, Continuum and Tomcat administrator user name is admin and has the same password in all three cases. More so I configured WebDAV (XML snippet above) in a way that the Tomcat's user admin has to be in role admin - otherwise Continuum will not be able to deploy site using WebDAV protocol.

That's basically it - I hope this post will be useful for some of you.

And why I chose Artifactory? Because I didn't know about the other options :) If you hesitate and don't know what to choose this blog post can help you: Maven Repository Managers - why we chose Archiva.
I am very satisfied about Artifactory - it works out-of-the-box and is serviceless application.

PS. As blogger is not Wiki you are not allowed to change the contents of this post. Nevertheless if you find some bugs or irrelevant information I would be grateful for your comments. I'll then fix this post and correct the mistakes.


wingerz said...

I just set up Sonatype's Nexus (another repo manager), and it is quite easy. Thanks to the slick GUI you don't have to muck around with XML config files.

Przemysław Bielicki said...

I see your point - this is quite frustrating that in order to add somoe repositories to Artifactory config you have to change the XML.

Good thing is that you can at least reload this config file from the GUI without restarting the server :)

Yoav Landman said...

Starting with version 1.3.0-beta-6 (due any day now) Artifactory is fully configurable via the web UI. The XSD-driven XML configuration is still there at the back if you wish to edit it directly with any code-completing tool.

Przemysław Bielicki said...

Cool :)

Anonymous said...

not sure it's necessary to configure tomcat for webdav anymore, there appears to be a maven extension for it.