Running a Maven repository manager using Apache WebDav

This posting continues the series on moving from an Ant to a Maven build.

Implementing a Maven repository manager using Apache's HTTPd with WebDav is straightforward. For this example, create the directory tree

├── apache2
│   ├── httpd.conf
│   └── logs
└── www
    └── repository

For the purposes of this example the directory tree is in /var/maven/

The httpd.conf file contains

LoadModule mpm_prefork_module libexec/apache2/
LoadModule unixd_module libexec/apache2/ 
LoadModule authz_core_module libexec/apache2/  
LoadModule access_compat_module libexec/apache2/   
LoadModule mime_module libexec/apache2/ 

LoadModule dav_module libexec/apache2/
LoadModule dav_fs_module libexec/apache2/

ServerRoot ${BASEDIR}/apache2
LogLevel warn
PidFile logs/

Listen 8080
ServerName localhost:8080

AddType application/octet-stream .sha1
AddType application/octet-stream .md5
AddType text/xml .xml
AddType text/xml .pom
AddType application/octet-stream .jar
AddType application/octet-stream .war

DocumentRoot ${BASEDIR}/www

DavLockDB DavLock
<Directory />
    DAV On

Start the HTTP server (in the foreground) using

BASEDIR=/var/maven/ httpd -f /var/maven/apache2/httpd.conf -X

For Maven deploy to this repository manager you need to make two changes to your pom.xml. The first is to include the extension in the <build/> section


The second is to use the "dav:" prefix to your <distributionManagement/> element URLs

    <name>Neighborhood Snapshots</name>
    <name>Neighborhood Releases</name>

To deploy your project use

mvn clean package deploy

This posting is part of the series about moving to Maven from an ancient Ant build.