Introduction
For test and other purposes Apache Directory Project Snapshots can be deployed to a custom location (e.g. locally). This guide will walk you through the process by preparing your maven configuration.
This is thought mainly for site-deployment and snapshot-deployment of artifacts. For release-deployment of artifacts see Guide to Directory Releases
Maven Settings
You'll need a profiles section to add the properties needed for customization. Here's what my settings.xml file in ~/.m2 looks like:
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <profiles> <profile> <id>deploy-local</id> <properties> <!-- This property is needed to customize where the goal 'deploy' will deploy artifacts to --> <distMgmtSnapshotsUrl>scpexe://localhost/tmp/local-directory-deployment</distMgmtSnapshotsUrl> <!-- This property is needed to customize where the goal 'site-deploy' will deploy the generated site to --> <distMgmtSiteUrl>scpexe://localhost/tmp/local-directory-site-deployment/</distMgmtSiteUrl> </properties> </profile> <profiles> <!-- In some cases you may need to add some credential information --> <!-- See also http://maven.apache.org/developers/committer-settings.html --> <servers> <server> <id>apache.snapshots.https</id> <username>{user}</username> <privateKey>{user.home}/.ssh/id_dsa</privateKey> <configuration> <sshExecutable>ssh</sshExecutable> <scpExecutable>scp</scpExecutable> </configuration> </server> <servers> </settings>
Of course these properties can also be set directly via command line, e.g.
mvn clean deploy -DdistMgmtSnapshotsUrl=scpexe://localhost/tmp/local-directory-deployment mvn clean site-deploy -DdistMgmtSiteUrl=scpexe://localhost/tmp/local-directory-site-deployment/